From 8e75107bf50ca1a8035d2c18105749708d790880 Mon Sep 17 00:00:00 2001 From: levlam Date: Sat, 7 Jul 2018 03:03:01 +0300 Subject: [PATCH] Allow ordinary users to edit messages with reply markup. GitOrigin-RevId: 1c526e779dfada1266f737277aceda5347dc6355 --- td/telegram/MessagesManager.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 66ff7ddd..35b19f75 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -17905,7 +17905,7 @@ bool MessagesManager::can_edit_message(DialogId dialog_id, const Message *m, boo if (m->had_reply_markup) { return false; } - if (!is_bot && m->reply_markup != nullptr) { + if (!is_bot && only_reply_markup) { return false; } if (m->reply_markup != nullptr && m->reply_markup->type != ReplyMarkup::Type::InlineKeyboard) { @@ -17978,7 +17978,7 @@ bool MessagesManager::can_edit_message(DialogId dialog_id, const Message *m, boo case MessageVoiceNote::ID: return true; case MessageLiveLocation::ID: { - if (td_->auth_manager_->is_bot() && only_reply_markup) { + if (is_bot && only_reply_markup) { // there is no caption to edit, but bot can edit inline reply_markup return true; } @@ -17990,7 +17990,7 @@ bool MessagesManager::can_edit_message(DialogId dialog_id, const Message *m, boo case MessageVenue::ID: case MessageVideoNote::ID: // there is no caption to edit, but bot can edit inline reply_markup - return td_->auth_manager_->is_bot() && only_reply_markup; + return is_bot && only_reply_markup; case MessageInvoice::ID: case MessageUnsupported::ID: case MessageChatCreate::ID: