[polari/wip/fmuellner/combined-gsoc: 107/136] clean _onChannelChanged() a bit
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari/wip/fmuellner/combined-gsoc: 107/136] clean _onChannelChanged() a bit
- Date: Tue, 26 Jul 2016 23:24:58 +0000 (UTC)
commit 744299b1402136567d36476301df27f03e2e8a40
Author: raresv <rares visalom gmail com>
Date: Wed Jul 20 18:53:09 2016 +0300
clean _onChannelChanged() a bit
src/userTracker.js | 32 ++++++++++++--------------------
1 files changed, 12 insertions(+), 20 deletions(-)
---
diff --git a/src/userTracker.js b/src/userTracker.js
index 39cea0c..d27a831 100644
--- a/src/userTracker.js
+++ b/src/userTracker.js
@@ -143,30 +143,22 @@ const UserTracker = new Lang.Class({
},
_onChannelChanged: function(room) {
- /* You can save one level of indentation by doing:
-
if (!room.channel) {
this._clearUsersFromRoom(room);
return;
}
- */
-
- if (room.channel) {
- let members;
- if (room.type == Tp.HandleType.ROOM)
- members = room.channel.group_dup_members_contacts();
- else
- members = [room.channel.connection.self_contact, room.channel.target_contact];
-
- /*TODO: is this needed here?*/
- this._ensureRoomMappingForRoom(room);
-
- /*keep track of initial members in the room, both locally and
- globally*/
- members.forEach(m => { this._trackMember(m, room); });
- } else {
- this._clearUsersFromRoom(room);
- }
+
+ let members;
+ if (room.type == Tp.HandleType.ROOM)
+ members = room.channel.group_dup_members_contacts();
+ else
+ members = [room.channel.connection.self_contact, room.channel.target_contact];
+
+ this._ensureRoomMappingForRoom(room);
+
+ /*keep track of initial members in the room, both locally and
+ globally*/
+ members.forEach(m => { this._trackMember(m, room); });
},
_clearUsersFromRoom: function(room) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]