[polari/wip/raresv/popoverRebasedOnTracker] room signals are now stored in a local variable, not a class private property
- From: Rares Visalom <raresvisalom src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari/wip/raresv/popoverRebasedOnTracker] room signals are now stored in a local variable, not a class private property
- Date: Fri, 22 Jul 2016 13:10:21 +0000 (UTC)
commit c110a91d3f15c08e002319e164cad3f6648fd0c2
Author: raresv <rares visalom gmail com>
Date: Wed Jul 20 18:33:54 2016 +0300
room signals are now stored in a local variable, not a class private property
src/userTracker.js | 39 ++++++++++++++++++---------------------
1 files changed, 18 insertions(+), 21 deletions(-)
---
diff --git a/src/userTracker.js b/src/userTracker.js
index 51a4a4c..13d3a85 100644
--- a/src/userTracker.js
+++ b/src/userTracker.js
@@ -73,26 +73,6 @@ const UserTracker = new Lang.Class({
_init: function(account) {
this.parent();
- /* not sure what "reference" in the name refers to, but it's weird
- * to have that as a property if it's just used in one place
- * somewhere else */
- this._referenceRoomSignals = [
- { name: 'notify::channel',
- handler: Lang.bind(this, this._onChannelChanged) },
- { name: 'member-renamed',
- handler: Lang.bind(this, this._onMemberRenamed) },
- { name: 'member-disconnected',
- handler: Lang.bind(this, this._onMemberLeft) },
- { name: 'member-kicked',
- handler: Lang.bind(this, this._onMemberLeft) },
- { name: 'member-banned',
- handler: Lang.bind(this, this._onMemberLeft) },
- { name: 'member-joined',
- handler: Lang.bind(this, this._onMemberJoined) },
- { name: 'member-left',
- handler: Lang.bind(this, this._onMemberLeft) }
- ];
-
this._account = account;
/* 'mapping' doesn't really add much if it's unclear what the
@@ -138,8 +118,25 @@ const UserTracker = new Lang.Class({
let roomData = this._roomMapping.get(room);
+ let roomSignals = [
+ { name: 'notify::channel',
+ handler: Lang.bind(this, this._onChannelChanged) },
+ { name: 'member-renamed',
+ handler: Lang.bind(this, this._onMemberRenamed) },
+ { name: 'member-disconnected',
+ handler: Lang.bind(this, this._onMemberLeft) },
+ { name: 'member-kicked',
+ handler: Lang.bind(this, this._onMemberLeft) },
+ { name: 'member-banned',
+ handler: Lang.bind(this, this._onMemberLeft) },
+ { name: 'member-joined',
+ handler: Lang.bind(this, this._onMemberJoined) },
+ { name: 'member-left',
+ handler: Lang.bind(this, this._onMemberLeft) }
+ ];
+
roomData._roomSignals = [];
- this._referenceRoomSignals.forEach(Lang.bind(this, function(signal) {
+ roomSignals.forEach(Lang.bind(this, function(signal) {
roomData._roomSignals.push(room.connect(signal.name, signal.handler));
}));
},
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]