From 5d1323311adf0905fc6729563c99ab2006a13277 Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 8 Jun 2018 19:56:26 +0300 Subject: [PATCH] Disable updating notification settings for bots. GitOrigin-RevId: 7562ea7dd624ba95af875f03b354f94dac95bbbb --- td/telegram/MessagesManager.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 72ba3d182..84bd02b33 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -6449,6 +6449,10 @@ void MessagesManager::on_scope_unmute(NotificationSettingsScope scope) { void MessagesManager::on_update_dialog_notify_settings( DialogId dialog_id, tl_object_ptr &&peer_notify_settings) { + if (td_->auth_manager_->is_bot()) { + return; + } + LOG(INFO) << "Receive notification settings for " << dialog_id << ": " << to_string(peer_notify_settings); const DialogNotificationSettings notification_settings = @@ -6466,6 +6470,10 @@ void MessagesManager::on_update_dialog_notify_settings( void MessagesManager::on_update_scope_notify_settings( NotificationSettingsScope scope, tl_object_ptr &&peer_notify_settings) { + if (td_->auth_manager_->is_bot()) { + return; + } + const ScopeNotificationSettings notification_settings = get_scope_notification_settings(std::move(peer_notify_settings)); if (!notification_settings.is_synchronized) {