From 67565c9c34e7ca1f0fe0b89ed86651dfa6394638 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 20 Apr 2020 00:59:09 +0300 Subject: [PATCH] Allow to delete local and scheduled messages. GitOrigin-RevId: 5cc1fbe54fb0ea55fbc46e1f7ed1b1b138fd1edd --- td/telegram/MessagesManager.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 3eaa1397..3148ab6b 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -8484,10 +8484,13 @@ bool MessagesManager::can_delete_message(DialogId dialog_id, const Message *m) c if (m == nullptr) { return true; } + if (m->message_id.is_local()) { + return true; + } switch (dialog_id.get_type()) { case DialogType::User: if (G()->unix_time_cached() < m->date + 86400 && m->content->get_type() == MessageContentType::Dice && - dialog_id != get_my_dialog_id()) { + dialog_id != get_my_dialog_id() && !m->message_id.is_scheduled()) { return false; } return true;