mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Fix stale mention / reaction badges.
This commit is contained in:
parent
3aebf59a61
commit
e4811505c8
2 changed files with 10 additions and 3 deletions
|
@ -1522,7 +1522,7 @@ void HistoryItem::applyEdition(HistoryMessageEdition &&edition) {
|
|||
setText(std::move(updatedText));
|
||||
}
|
||||
if (!isLocalUpdateMedia() && !updatingSavedLocalEdit) {
|
||||
indexAsNewItem();
|
||||
addToSharedMediaIndex();
|
||||
}
|
||||
if (!edition.useSameReplies) {
|
||||
if (!edition.replies.isNull) {
|
||||
|
@ -1633,7 +1633,7 @@ void HistoryItem::applySentMessage(const MTPDmessage &data) {
|
|||
setPostAuthor(data.vpost_author().value_or_empty());
|
||||
setIsPinned(data.is_pinned());
|
||||
contributeToSlowmode(data.vdate().v);
|
||||
indexAsNewItem();
|
||||
addToSharedMediaIndex();
|
||||
invalidateChatListEntry();
|
||||
if (const auto period = data.vttl_period(); period && period->v > 0) {
|
||||
applyTTL(data.vdate().v + period->v);
|
||||
|
@ -1657,7 +1657,7 @@ void HistoryItem::applySentMessage(
|
|||
}, data.vmedia());
|
||||
contributeToSlowmode(data.vdate().v);
|
||||
if (!wasAlready) {
|
||||
indexAsNewItem();
|
||||
addToSharedMediaIndex();
|
||||
}
|
||||
invalidateChatListEntry();
|
||||
if (const auto period = data.vttl_period(); period && period->v > 0) {
|
||||
|
@ -1819,6 +1819,12 @@ Storage::SharedMediaTypesMask HistoryItem::sharedMediaTypes() const {
|
|||
void HistoryItem::indexAsNewItem() {
|
||||
if (isRegular()) {
|
||||
addToUnreadThings(HistoryUnreadThings::AddType::New);
|
||||
}
|
||||
addToSharedMediaIndex();
|
||||
}
|
||||
|
||||
void HistoryItem::addToSharedMediaIndex() {
|
||||
if (isRegular()) {
|
||||
if (const auto types = sharedMediaTypes()) {
|
||||
_history->session().storage().add(Storage::SharedMediaAddNew(
|
||||
_history->peer->id,
|
||||
|
|
|
@ -359,6 +359,7 @@ public:
|
|||
[[nodiscard]] Storage::SharedMediaTypesMask sharedMediaTypes() const;
|
||||
|
||||
void indexAsNewItem();
|
||||
void addToSharedMediaIndex();
|
||||
void removeFromSharedMediaIndex();
|
||||
|
||||
struct NotificationTextOptions {
|
||||
|
|
Loading…
Add table
Reference in a new issue