[polari] ircParser: Add room parameter
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari] ircParser: Add room parameter
- Date: Sat, 30 Jul 2016 22:38:02 +0000 (UTC)
commit 9ed2055888320f23f3a4d80ab3b56395c2f25e0d
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 one 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]