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
This commit is contained in:
Giovanni Campagna 2014-02-09 19:19:36 +01:00
parent 492558a2d2
commit 6ce6e86318

View File

@ -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));
}
}));
},