diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index fd0ebaf7a..8eb280ed3 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -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 diff --git a/td/telegram/GlobalPrivacySettings.cpp b/td/telegram/GlobalPrivacySettings.cpp index d39b5762f..b6001b577 100644 --- a/td/telegram/GlobalPrivacySettings.cpp +++ b/td/telegram/GlobalPrivacySettings.cpp @@ -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 &&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 &&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) {