[polari] chatroomManager: Also remove rooms whose account has been deleted



commit 59736742e7642ecfdf7bfddb06d1e5a42988ea92
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Feb 27 23:45:07 2014 +0100

    chatroomManager: Also remove rooms whose account has been deleted
    
    Since commit 0827a395dc24d we remove a room when its account is
    disabled. This makes even more sense when the account is completely
    removed, so handle that case as well.

 src/chatroomManager.js |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/chatroomManager.js b/src/chatroomManager.js
index 40ec4ea..8a2b0ca 100644
--- a/src/chatroomManager.js
+++ b/src/chatroomManager.js
@@ -81,6 +81,8 @@ const _ChatroomManager = new Lang.Class({
                    Lang.bind(this, this._restoreSavedChannels));
         am.connect('account-disabled',
                    Lang.bind(this, this._onAccountDisabled));
+        am.connect('account-removed',
+                   Lang.bind(this, this._onAccountDisabled));
         this._restoreSavedChannels();
 
         this._networkMonitor.connect('notify::network-available', Lang.bind(this,
@@ -93,7 +95,7 @@ const _ChatroomManager = new Lang.Class({
     _onAccountDisabled: function(am, account) {
         for (let id in this._rooms) {
             let room = this._rooms[id];
-            if (!room.account.enabled)
+            if (room.account == account)
                 this._removeRoom(room);
         }
     },


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