[polari/wip/fmuellner/combined-gsoc: 88/137] userTracker: Cut-down on signals handlers
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari/wip/fmuellner/combined-gsoc: 88/137] userTracker: Cut-down on signals handlers
- Date: Thu, 28 Jul 2016 16:22:50 +0000 (UTC)
commit 1ee9dc7df6452791c8d423c1f6e3ac9e5690434c
Author: Florian Müllner <fmuellner gnome org>
Date: Thu Jul 14 04:22:08 2016 +0200
userTracker: Cut-down on signals handlers
We don't care about whether a user left or was kicked/banned - just
use the same handler for all those signals.
src/userTracker.js | 20 ++++----------------
1 files changed, 4 insertions(+), 16 deletions(-)
---
diff --git a/src/userTracker.js b/src/userTracker.js
index bd73ab4..53adf3c 100644
--- a/src/userTracker.js
+++ b/src/userTracker.js
@@ -81,11 +81,11 @@ const UserTracker = new Lang.Class({
{ name: 'member-renamed',
handler: Lang.bind(this, this._onMemberRenamed) },
{ name: 'member-disconnected',
- handler: Lang.bind(this, this._onMemberDisconnected) },
+ handler: Lang.bind(this, this._onMemberLeft) },
{ name: 'member-kicked',
- handler: Lang.bind(this, this._onMemberKicked) },
+ handler: Lang.bind(this, this._onMemberLeft) },
{ name: 'member-banned',
- handler: Lang.bind(this, this._onMemberBanned) },
+ handler: Lang.bind(this, this._onMemberLeft) },
{ name: 'member-joined',
handler: Lang.bind(this, this._onMemberJoined) },
{ name: 'member-left',
@@ -202,23 +202,11 @@ const UserTracker = new Lang.Class({
this._trackMember(newMember, room);
},
- _onMemberDisconnected: function(room, member, message) {
- this._untrackMember(member, room);
- },
-
- _onMemberKicked: function(room, member, actor) {
- this._untrackMember(member, room);
- },
-
- _onMemberBanned: function(room, member, actor) {
- this._untrackMember(member, room);
- },
-
_onMemberJoined: function(room, member) {
this._trackMember(member, room);
},
- _onMemberLeft: function(room, member, message) {
+ _onMemberLeft: function(room, member) {
this._untrackMember(member, room);
},
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]