[polari/wip/fmuellner/window-experiments: 8/29] ircParser: Add room parameter



commit 921c6390d29d671dc484e330f7298cfcce5beb89
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Jul 14 21:07:57 2016 +0200

    ircParser: Add room parameter
    
    There used to be a single IrcParser instance shared between all rooms,
    but this hasn't been the case for a while now - so rather than tracking
    the active room, we can simply pass in the correct from from the
    corresponding entry area.

 src/entryArea.js |    2 +-
 src/ircParser.js |    9 ++-------
 2 files changed, 3 insertions(+), 8 deletions(-)
---
diff --git a/src/entryArea.js b/src/entryArea.js
index ce4761c..b1b8057 100644
--- a/src/entryArea.js
+++ b/src/entryArea.js
@@ -119,7 +119,7 @@ const EntryArea = new Lang.Class({
         this._room = params.room;
         delete params.room;
 
-        this._ircParser = new IrcParser.IrcParser();
+        this._ircParser = new IrcParser.IrcParser(this._room);
         this._maxNickChars = ChatView.MAX_NICK_CHARS;
 
         this.parent(params);
diff --git a/src/ircParser.js b/src/ircParser.js
index 948ff2b..2be4e04 100644
--- a/src/ircParser.js
+++ b/src/ircParser.js
@@ -42,15 +42,10 @@ const UNKNOWN_COMMAND_MESSAGE =
 const IrcParser = new Lang.Class({
     Name: 'IrcParser',
 
-    _init: function() {
+    _init: function(room) {
         this._app = Gio.Application.get_default();
         this._roomManager = ChatroomManager.getDefault();
-
-        this._roomManager.connect('active-changed', Lang.bind(this,
-            function(manager, room) {
-                this._room = room;
-            }));
-        this._room = null;
+        this._room = room;
     },
 
     _createFeedbackLabel: function(text) {


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