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



commit 274b10b25449154a1ba7081445a82156837f71f4
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Jul 15 00:12:18 2016 +0200

    roomStack: Pick up list of rooms

 src/roomStack.js |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)
---
diff --git a/src/roomStack.js b/src/roomStack.js
index 859a08b..7a7b03c 100644
--- a/src/roomStack.js
+++ b/src/roomStack.js
@@ -26,13 +26,6 @@ const RoomStack = new Lang.Class({
         this._sizeGroup = new Gtk.SizeGroup({ mode: Gtk.SizeGroupMode.VERTICAL });
         this._rooms = {};
 
-        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.add_named(new ChatPlaceholder(this._sizeGroup), 'placeholder');
 
         this._entryAreaHeight = 0;
@@ -41,6 +34,17 @@ const RoomStack = new Lang.Class({
                 this._entryAreaHeight = rect.height - 1;
                 this.notify('entry-area-height');
             }));
+
+        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._roomManager.forEachRoom(room => {
+            this._roomAdded(this._roomManager, room);
+        });
     },
 
     vfunc_realize: function() {


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