From a925c22469db933046132d82f450dc3abe8f05b8 Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 11 Sep 2020 22:01:55 +0300 Subject: [PATCH] Do not send dialog actions by anonymous administrators. GitOrigin-RevId: c67c1fc5b2ca97fb4a261d224af42b0be49f6807 --- td/telegram/MessagesManager.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index ab4b40cdc..0197c5974 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -20470,8 +20470,9 @@ bool MessagesManager::is_anonymous_administrator(UserId sender_user_id, DialogId return false; } - CHECK(author_signature != nullptr); - *author_signature = status.get_rank(); + if (author_signature != nullptr) { + *author_signature = status.get_rank(); + } return true; } @@ -27310,6 +27311,9 @@ bool MessagesManager::is_dialog_action_unneded(DialogId dialog_id) const { if (is_broadcast_channel(dialog_id)) { return true; } + if (is_anonymous_administrator(td_->contacts_manager_->get_my_id(), dialog_id, nullptr)) { + return true; + } auto dialog_type = dialog_id.get_type(); if (dialog_type == DialogType::User || dialog_type == DialogType::SecretChat) {