diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp index c078b50f2..656bb53df 100644 --- a/Telegram/SourceFiles/history/history_item.cpp +++ b/Telegram/SourceFiles/history/history_item.cpp @@ -63,6 +63,7 @@ not_null CreateUnsupportedMessage( text.entities.push_front( EntityInText(EntityInTextItalic, 0, text.text.size())); flags &= ~MTPDmessage::Flag::f_post_author; + flags |= MTPDmessage_ClientFlag::f_is_unsupported; return new HistoryMessage( history, msgId, diff --git a/Telegram/SourceFiles/history/history_message.cpp b/Telegram/SourceFiles/history/history_message.cpp index 4d35f71b7..c1d1f4c3c 100644 --- a/Telegram/SourceFiles/history/history_message.cpp +++ b/Telegram/SourceFiles/history/history_message.cpp @@ -603,7 +603,8 @@ bool HistoryMessage::isTooOldForEdit(TimeId now) const { bool HistoryMessage::allowsEdit(TimeId now) const { return canStopPoll() && !isTooOldForEdit(now) - && (!_media || _media->allowsEdit()); + && (!_media || _media->allowsEdit()) + && !isUnsupportedMessage(); } bool HistoryMessage::uploading() const { diff --git a/Telegram/SourceFiles/history/history_message.h b/Telegram/SourceFiles/history/history_message.h index 011c6cec0..edbaf5584 100644 --- a/Telegram/SourceFiles/history/history_message.h +++ b/Telegram/SourceFiles/history/history_message.h @@ -149,6 +149,9 @@ private: return _flags & MTPDmessage_ClientFlag::f_has_admin_badge; } bool isTooOldForEdit(TimeId now) const; + bool isUnsupportedMessage() const { + return _flags & MTPDmessage_ClientFlag::f_is_unsupported; + } // For an invoice button we replace the button text with a "Receipt" key. // It should show the receipt for the payed invoice. Still let mobile apps do that. diff --git a/Telegram/SourceFiles/mtproto/type_utils.h b/Telegram/SourceFiles/mtproto/type_utils.h index 5aa62efb9..e53d908c5 100644 --- a/Telegram/SourceFiles/mtproto/type_utils.h +++ b/Telegram/SourceFiles/mtproto/type_utils.h @@ -68,8 +68,8 @@ enum class MTPDmessage_ClientFlag : uint32 { // message has an admin badge in supergroup f_has_admin_badge = (1U << 20), - //// message is not displayed because it is part of a group - //f_hidden_by_group = (1U << 19), + // message is unsupported by a current version of client + f_is_unsupported = (1U << 19), // update this when adding new client side flags MIN_FIELD = (1U << 19),