mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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));
|
setText(std::move(updatedText));
|
||||||
}
|
}
|
||||||
if (!isLocalUpdateMedia() && !updatingSavedLocalEdit) {
|
if (!isLocalUpdateMedia() && !updatingSavedLocalEdit) {
|
||||||
indexAsNewItem();
|
addToSharedMediaIndex();
|
||||||
}
|
}
|
||||||
if (!edition.useSameReplies) {
|
if (!edition.useSameReplies) {
|
||||||
if (!edition.replies.isNull) {
|
if (!edition.replies.isNull) {
|
||||||
|
@ -1633,7 +1633,7 @@ void HistoryItem::applySentMessage(const MTPDmessage &data) {
|
||||||
setPostAuthor(data.vpost_author().value_or_empty());
|
setPostAuthor(data.vpost_author().value_or_empty());
|
||||||
setIsPinned(data.is_pinned());
|
setIsPinned(data.is_pinned());
|
||||||
contributeToSlowmode(data.vdate().v);
|
contributeToSlowmode(data.vdate().v);
|
||||||
indexAsNewItem();
|
addToSharedMediaIndex();
|
||||||
invalidateChatListEntry();
|
invalidateChatListEntry();
|
||||||
if (const auto period = data.vttl_period(); period && period->v > 0) {
|
if (const auto period = data.vttl_period(); period && period->v > 0) {
|
||||||
applyTTL(data.vdate().v + period->v);
|
applyTTL(data.vdate().v + period->v);
|
||||||
|
@ -1657,7 +1657,7 @@ void HistoryItem::applySentMessage(
|
||||||
}, data.vmedia());
|
}, data.vmedia());
|
||||||
contributeToSlowmode(data.vdate().v);
|
contributeToSlowmode(data.vdate().v);
|
||||||
if (!wasAlready) {
|
if (!wasAlready) {
|
||||||
indexAsNewItem();
|
addToSharedMediaIndex();
|
||||||
}
|
}
|
||||||
invalidateChatListEntry();
|
invalidateChatListEntry();
|
||||||
if (const auto period = data.vttl_period(); period && period->v > 0) {
|
if (const auto period = data.vttl_period(); period && period->v > 0) {
|
||||||
|
@ -1819,6 +1819,12 @@ Storage::SharedMediaTypesMask HistoryItem::sharedMediaTypes() const {
|
||||||
void HistoryItem::indexAsNewItem() {
|
void HistoryItem::indexAsNewItem() {
|
||||||
if (isRegular()) {
|
if (isRegular()) {
|
||||||
addToUnreadThings(HistoryUnreadThings::AddType::New);
|
addToUnreadThings(HistoryUnreadThings::AddType::New);
|
||||||
|
}
|
||||||
|
addToSharedMediaIndex();
|
||||||
|
}
|
||||||
|
|
||||||
|
void HistoryItem::addToSharedMediaIndex() {
|
||||||
|
if (isRegular()) {
|
||||||
if (const auto types = sharedMediaTypes()) {
|
if (const auto types = sharedMediaTypes()) {
|
||||||
_history->session().storage().add(Storage::SharedMediaAddNew(
|
_history->session().storage().add(Storage::SharedMediaAddNew(
|
||||||
_history->peer->id,
|
_history->peer->id,
|
||||||
|
|
|
@ -359,6 +359,7 @@ public:
|
||||||
[[nodiscard]] Storage::SharedMediaTypesMask sharedMediaTypes() const;
|
[[nodiscard]] Storage::SharedMediaTypesMask sharedMediaTypes() const;
|
||||||
|
|
||||||
void indexAsNewItem();
|
void indexAsNewItem();
|
||||||
|
void addToSharedMediaIndex();
|
||||||
void removeFromSharedMediaIndex();
|
void removeFromSharedMediaIndex();
|
||||||
|
|
||||||
struct NotificationTextOptions {
|
struct NotificationTextOptions {
|
||||||
|
|
Loading…
Add table
Reference in a new issue