GNOME Bugzilla – Bug 770888
telepathyClient: Always clear pending messages on destroy
Last modified: 2016-09-10 17:04:49 UTC
See patch. I'm still divided on just ignoring whether or not we are handling the channel and ack'ing messages unconditionally on destroy, but for now I went with the formally more correct approach of not touching channels we aren't handling ...
Created attachment 334783 [details] [review] telepathyClient: Always clear pending messages on destroy Since commit 82950ecea, we acknowledge pending messages when closing a chat notification for a channel we are handling to prevent the channel from popping up again immediately. While this isn't an issue for channels we don't handle, the unread messages of the destroyed notification are still considered for the messages indicator in the top bar, which is clearly confusing (in particular when we end up showing the indicator without any notifications in the list). As it's arguably correct to not meddle with a channel handled by someone else, just reset the cache of pending messages to address this issue.
Review of attachment 334783 [details] [review]: I'm not familiar with this code but, why do we queue messages from channels we don't handle into this._pendingMessages in the first place? Anyway, this looks fine if you want to push as is
(In reply to Rui Matos from comment #2) > I'm not familiar with this code but, why do we queue messages from channels > we don't handle into this._pendingMessages in the first place? In this case, "handling" the channel means "owning" it. In practice, we handle the channel (at least initially) when someone starts a private chat with you, and whatever client you are using handles the channel when you start a private chat with someone. That's not a user-visible concept though, we still show the same type of notification in both cases. (There are also channels we don't "handle" in the common sense of the word, that is we ignore them - we don't queue messages at all for those)
Ok, then it does indeed make sense to clear the queue when the notification is destroyed.
Hmmm, somehow git-bz didn't work yesterday ... Attachment 334783 [details] pushed as 06d0e7d - telepathyClient: Always clear pending messages on destroy