mirror of
https://github.com/vale981/tdesktop
synced 2025-03-05 17:51:41 -05:00
Fixed an editing of unsupported messages.
This commit is contained in:
parent
b00ca217b3
commit
be0b0c1984
4 changed files with 8 additions and 3 deletions
|
@ -63,6 +63,7 @@ not_null<HistoryItem*> CreateUnsupportedMessage(
|
||||||
text.entities.push_front(
|
text.entities.push_front(
|
||||||
EntityInText(EntityInTextItalic, 0, text.text.size()));
|
EntityInText(EntityInTextItalic, 0, text.text.size()));
|
||||||
flags &= ~MTPDmessage::Flag::f_post_author;
|
flags &= ~MTPDmessage::Flag::f_post_author;
|
||||||
|
flags |= MTPDmessage_ClientFlag::f_is_unsupported;
|
||||||
return new HistoryMessage(
|
return new HistoryMessage(
|
||||||
history,
|
history,
|
||||||
msgId,
|
msgId,
|
||||||
|
|
|
@ -603,7 +603,8 @@ bool HistoryMessage::isTooOldForEdit(TimeId now) const {
|
||||||
bool HistoryMessage::allowsEdit(TimeId now) const {
|
bool HistoryMessage::allowsEdit(TimeId now) const {
|
||||||
return canStopPoll()
|
return canStopPoll()
|
||||||
&& !isTooOldForEdit(now)
|
&& !isTooOldForEdit(now)
|
||||||
&& (!_media || _media->allowsEdit());
|
&& (!_media || _media->allowsEdit())
|
||||||
|
&& !isUnsupportedMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HistoryMessage::uploading() const {
|
bool HistoryMessage::uploading() const {
|
||||||
|
|
|
@ -149,6 +149,9 @@ private:
|
||||||
return _flags & MTPDmessage_ClientFlag::f_has_admin_badge;
|
return _flags & MTPDmessage_ClientFlag::f_has_admin_badge;
|
||||||
}
|
}
|
||||||
bool isTooOldForEdit(TimeId now) const;
|
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.
|
// 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.
|
// 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
|
// message has an admin badge in supergroup
|
||||||
f_has_admin_badge = (1U << 20),
|
f_has_admin_badge = (1U << 20),
|
||||||
|
|
||||||
//// message is not displayed because it is part of a group
|
// message is unsupported by a current version of client
|
||||||
//f_hidden_by_group = (1U << 19),
|
f_is_unsupported = (1U << 19),
|
||||||
|
|
||||||
// update this when adding new client side flags
|
// update this when adding new client side flags
|
||||||
MIN_FIELD = (1U << 19),
|
MIN_FIELD = (1U << 19),
|
||||||
|
|
Loading…
Add table
Reference in a new issue