[polari/wip/fmuellner/window-experiments: 27/30] roomList: Pick up list of rooms



commit dfefda44ca95a731f4407735acb150fae6f5a7ac
Author: Florian Müllner <fmuellner gnome org>
Date:   Sat Jul 16 01:33:42 2016 +0200

    roomList: Pick up list of rooms

 src/roomList.js |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)
---
diff --git a/src/roomList.js b/src/roomList.js
index 51172d5..d778bf1 100644
--- a/src/roomList.js
+++ b/src/roomList.js
@@ -338,27 +338,31 @@ const RoomList = new Lang.Class({
         this._placeholders = {};
         this._roomRows = {};
 
+        this._roomManager = ChatroomManager.getDefault();
+        this._roomManager.connect('room-added',
+                                  Lang.bind(this, this._roomAdded));
+        this._roomManager.connect('room-removed',
+                                  Lang.bind(this, this._roomRemoved));
+
         this._accountsMonitor = AccountsMonitor.getDefault();
         let feature = Tp.AccountManager.get_feature_quark_core();
         let mon = this._accountsMonitor;
 
-        if (mon.accountManager.is_prepared(feature))
+        if (mon.accountManager.is_prepared(feature)) {
             this._onAccountManagerPrepared(mon, mon.accountManager);
-        else
+            this._roomManager.forEachRoom(room => {
+                this._roomAdded(this._roommanager, room);
+            });
+        } else {
             mon.connect('account-manager-prepared',
                         Lang.bind(this, this._onAccountManagerPrepared));
+        }
 
         this._accountsMonitor.connect('account-added',
                                       Lang.bind(this, this._accountAdded));
         this._accountsMonitor.connect('account-removed',
                                       Lang.bind(this, this._accountRemoved));
 
-        this._roomManager = ChatroomManager.getDefault();
-        this._roomManager.connect('room-added',
-                                  Lang.bind(this, this._roomAdded));
-        this._roomManager.connect('room-removed',
-                                  Lang.bind(this, this._roomRemoved));
-
         let action = Gio.Application.get_default().lookup_action('leave-room');
         action.connect('activate', Lang.bind(this, this._onLeaveActivated));
     },


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