fix: Emit MsgsChanged instead of MsgsNoticed on self-MDN if chat still has fresh messages#7741
Merged
Merged
Conversation
Simon-Laux
reviewed
Jan 19, 2026
Hocuri
approved these changes
Jan 19, 2026
| context.emit_event(EventType::MsgsNoticed(chat_id)); | ||
| } else { | ||
| // W/a for a not updated profile badge counter in Desktop v2.35.0. | ||
| context.emit_event(EventType::MsgsNoticed(DC_CHAT_ID_TRASH)); |
Collaborator
There was a problem hiding this comment.
Usually, we use MsgId::new(0) if we don't want to specify a MsgId in events. This doesn't work here? And MsgsChanged also doesn't work?
Collaborator
Author
There was a problem hiding this comment.
Thanks, MsgsChanged works in Desktop and it's not hacky at all, should work in all UIs. Then i'm going to add a test and merge this.
EDIT: MsgsChanged also allows to specify the chat it which is good.
134a693 to
b4d3f0e
Compare
…l has fresh messages Otherwise if the user reads messages being offline and then the device comes online, sent MDNs will remove all notifications from other devices even if new messages have arrived. Notifications not removed at all look more acceptable.
b4d3f0e to
0f0b012
Compare
Collaborator
Author
|
Tried to add a test, but it only works if |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Otherwise if the user reads messages being offline and then the device comes online, sent MDNs will remove all notifications from other devices even if new messages have arrived. Notifications not removed at all look more acceptable.
This is a follow-up PR as suggested in #7738 (comment). The idea comes from #7659.
Checked this in Desktop.
Can add a test if the change is agreed, but as the w/a for a not updated profile badge counter looks weird and may not work in all UIs, maybe we should emit another event.