[gnome-shell] telepathyClient: Always clear pending messages on destroy



commit 06d0e7d74a277a4eb72c003809baef281763d093
Author: Florian Müllner <fmuellner gnome org>
Date:   Sat Sep 3 22:24:29 2016 +0200

    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.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=770888

 js/ui/components/telepathyClient.js |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/components/telepathyClient.js b/js/ui/components/telepathyClient.js
index f07e599..927ca45 100644
--- a/js/ui/components/telepathyClient.js
+++ b/js/ui/components/telepathyClient.js
@@ -475,6 +475,11 @@ const ChatSource = new Lang.Class({
             this._channel.close_async(function(channel, result) {
                 channel.close_finish(result);
             });
+        } else {
+            // Don't indicate any unread messages when the notification
+            // that represents them has been destroyed.
+            this._pendingMessages = [];
+            this.countUpdated();
         }
 
         // Keep source alive while the channel is open


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]