[gnome-shell] TelepathyClient: destroy an existing account notification when the user goes offline



commit 6ce6e86318eb39dd0ead83a04a9c0981eb76409c
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Sun Feb 9 19:19:36 2014 +0100

    TelepathyClient: destroy an existing account notification when the user goes offline
    
    We already filter new notifications caused by the explicit
    user action, but we don't do so for changes to existing
    notifications.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=723976

 js/ui/components/telepathyClient.js |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/components/telepathyClient.js b/js/ui/components/telepathyClient.js
index 814e3d9..cbe7a18 100644
--- a/js/ui/components/telepathyClient.js
+++ b/js/ui/components/telepathyClient.js
@@ -1421,7 +1421,12 @@ const AccountNotification = new Lang.Class({
                 if (status == Tp.ConnectionStatus.CONNECTED) {
                     this.destroy();
                 } else if (status == Tp.ConnectionStatus.DISCONNECTED) {
-                    this.update(this.title, this._getMessage(account.connection_error));
+                    let connectionError = account.connection_error;
+
+                    if (connectionError == Tp.error_get_dbus_name(Tp.Error.CANCELLED))
+                        this.destroy();
+                    else
+                        this.update(this.title, this._getMessage(connectionError));
                 }
             }));
     },


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