mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-03-01 12:00:48 +00:00
Fixed an editing of unsupported messages.
This commit is contained in:
parent
b00ca217b3
commit
be0b0c1984
@ -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,
|
||||
|
@ -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 {
|
||||
|
@ -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.
|
||||
|
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user