Fixed an editing of unsupported messages.

This commit is contained in:
23rd 2018-12-26 09:18:53 +03:00 committed by John Preston
parent b00ca217b3
commit be0b0c1984
4 changed files with 8 additions and 3 deletions

View File

@ -63,6 +63,7 @@ not_null<HistoryItem*> 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,

View File

@ -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 {

View File

@ -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.

View File

@ -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),