Improve privacy settings.

This commit is contained in:
levlam 2024-01-24 18:59:53 +03:00
parent 94141a18dd
commit d7e35f4c44
2 changed files with 5 additions and 8 deletions

View File

@ -5394,8 +5394,8 @@ userPrivacySettingAllowFindingByPhoneNumber = UserPrivacySetting;
userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages = UserPrivacySetting;
//@description Contains privacy settings for message read date in private chats
//@show_read_date True, if message read date is shown to other users in private chats. If disabled and the current user isn't a Telegram Premium user, then they will not be able to see other's message read date
//@description Contains privacy settings for message read date in private chats. Read dates are always shown to the users that can see online status of the current user regardless of this setting
//@show_read_date True, if message read date is shown to other users in private chats. If false and the current user isn't a Telegram Premium user, then they will not be able to see other's message read date.
readDatePrivacySettings show_read_date:Bool = ReadDatePrivacySettings;
//@description Contains privacy settings for new chats with non-contacts

View File

@ -37,6 +37,7 @@ class GetGlobalPrivacySettingsQuery final : public Td::ResultHandler {
return on_error(result_ptr.move_as_error());
}
LOG(INFO) << "Receive result for GetGlobalPrivacySettingsQuery: " << to_string(result_ptr.ok());
promise_.set_value(GlobalPrivacySettings(result_ptr.move_as_ok()));
}
@ -90,16 +91,12 @@ GlobalPrivacySettings::GlobalPrivacySettings(td_api::object_ptr<td_api::archiveC
GlobalPrivacySettings::GlobalPrivacySettings(td_api::object_ptr<td_api::readDatePrivacySettings> &&settings)
: set_type_(SetType::ReadDate) {
if (settings != nullptr) {
hide_read_marks_ = !settings->show_read_date_;
}
hide_read_marks_ = settings == nullptr || !settings->show_read_date_;
}
GlobalPrivacySettings::GlobalPrivacySettings(td_api::object_ptr<td_api::newChatPrivacySettings> &&settings)
: set_type_(SetType::NewChat) {
if (settings != nullptr) {
new_noncontact_peers_require_premium_ = !settings->allow_new_chats_from_unknown_users_;
}
new_noncontact_peers_require_premium_ = settings == nullptr || !settings->allow_new_chats_from_unknown_users_;
}
void GlobalPrivacySettings::apply_changes(const GlobalPrivacySettings &set_settings) {