Fix tags for just-sent Saved Messages.
This commit is contained in:
parent
bec34c34b1
commit
f072173d7c
|
@ -765,7 +765,7 @@ HistoryItem::HistoryItem(
|
|||
: id(id)
|
||||
, _history(history)
|
||||
, _from(from ? history->owner().peer(from) : history->peer)
|
||||
, _flags(FinalizeMessageFlags(flags))
|
||||
, _flags(FinalizeMessageFlags(history, flags))
|
||||
, _date(date) {
|
||||
if (isHistoryEntry() && IsClientMsgId(id)) {
|
||||
_history->registerClientSideMessage(this);
|
||||
|
|
|
@ -624,11 +624,16 @@ std::optional<bool> PeerHasThisCall(
|
|||
});
|
||||
}
|
||||
|
||||
[[nodiscard]] MessageFlags FinalizeMessageFlags(MessageFlags flags) {
|
||||
[[nodiscard]] MessageFlags FinalizeMessageFlags(
|
||||
not_null<History*> history,
|
||||
MessageFlags flags) {
|
||||
if (!(flags & MessageFlag::FakeHistoryItem)
|
||||
&& !(flags & MessageFlag::IsOrWasScheduled)
|
||||
&& !(flags & MessageFlag::AdminLogEntry)) {
|
||||
flags |= MessageFlag::HistoryEntry;
|
||||
if (history->peer->isSelf()) {
|
||||
flags |= MessageFlag::ReactionsAreTags;
|
||||
}
|
||||
}
|
||||
return flags;
|
||||
}
|
||||
|
|
|
@ -66,7 +66,9 @@ void CheckReactionNotificationSchedule(
|
|||
not_null<PeerData*> peer,
|
||||
PeerId from,
|
||||
not_null<HistoryItem*> fwd);
|
||||
[[nodiscard]] MessageFlags FinalizeMessageFlags(MessageFlags flags);
|
||||
[[nodiscard]] MessageFlags FinalizeMessageFlags(
|
||||
not_null<History*> history,
|
||||
MessageFlags flags);
|
||||
[[nodiscard]] bool CopyMarkupToForward(not_null<const HistoryItem*> item);
|
||||
[[nodiscard]] TextWithEntities EnsureNonEmpty(
|
||||
const TextWithEntities &text = TextWithEntities());
|
||||
|
|
Loading…
Reference in New Issue