Fix updating ScopeNotificationSettings on server.

GitOrigin-RevId: 017ca08db0c37d951887e77a25484b71f838c5cd
This commit is contained in:
levlam 2018-07-24 18:17:28 +03:00
parent 2ffabd63ba
commit e171c6490f

View File

@ -3178,16 +3178,9 @@ class UpdateScopeNotifySettingsQuery : public Td::ResultHandler {
void send(NotificationSettingsScope scope, const ScopeNotificationSettings &new_settings) { void send(NotificationSettingsScope scope, const ScopeNotificationSettings &new_settings) {
auto input_notify_peer = td->messages_manager_->get_input_notify_peer(scope); auto input_notify_peer = td->messages_manager_->get_input_notify_peer(scope);
CHECK(input_notify_peer != nullptr); CHECK(input_notify_peer != nullptr);
int32 flags = 0; int32 flags = telegram_api::inputPeerNotifySettings::MUTE_UNTIL_MASK |
if (new_settings.mute_until != 0) { telegram_api::inputPeerNotifySettings::SOUND_MASK |
flags |= telegram_api::inputPeerNotifySettings::MUTE_UNTIL_MASK; telegram_api::inputPeerNotifySettings::SHOW_PREVIEWS_MASK;
}
if (new_settings.sound != "default") {
flags |= telegram_api::inputPeerNotifySettings::SOUND_MASK;
}
if (new_settings.show_preview) {
flags |= telegram_api::inputPeerNotifySettings::SHOW_PREVIEWS_MASK;
}
send_query(G()->net_query_creator().create(create_storer(telegram_api::account_updateNotifySettings( send_query(G()->net_query_creator().create(create_storer(telegram_api::account_updateNotifySettings(
std::move(input_notify_peer), std::move(input_notify_peer),
make_tl_object<telegram_api::inputPeerNotifySettings>(flags, new_settings.show_preview, false, make_tl_object<telegram_api::inputPeerNotifySettings>(flags, new_settings.show_preview, false,