From 86c923438823ec4883708b0d1e7322c9651f3511 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 25 Jul 2018 02:59:05 +0300 Subject: [PATCH] Fix can_delete_for_everyone flag in closed secret chats. GitOrigin-RevId: 4db2dd4ac884d65c9f7f93a9dff19ee4f207766d --- td/telegram/MessagesManager.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index f82fe3ad1..501a8d4da 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -8231,8 +8231,9 @@ bool MessagesManager::can_revoke_message(DialogId dialog_id, const Message *m) c case DialogType::Channel: return true; // any server message that can be deleted will be deleted for all participants case DialogType::SecretChat: - return !is_service_message_content( - m->content->get_id()); // all non-service messages will be deleted for everyone + // all non-service messages will be deleted for everyone if secret chat is active + return td_->contacts_manager_->get_secret_chat_state(dialog_id.get_secret_chat_id()) == SecretChatState::Active && + !is_service_message_content(m->content->get_id()); case DialogType::None: default: UNREACHABLE();