[polari/wip/fmuellner/combined-gsoc: 96/103] move getNickRoomStatus()



commit 5bb3f320fbb8770cb64b4a2599c214f7b830516b
Author: raresv <rares visalom gmail com>
Date:   Wed Jul 20 18:55:17 2016 +0300

    move getNickRoomStatus()

 src/userTracker.js |   21 ++++++++++-----------
 1 files changed, 10 insertions(+), 11 deletions(-)
---
diff --git a/src/userTracker.js b/src/userTracker.js
index d27a831..cab514a 100644
--- a/src/userTracker.js
+++ b/src/userTracker.js
@@ -269,6 +269,16 @@ const UserTracker = new Lang.Class({
                                     : Tp.ConnectionPresenceType.AVAILABLE;
     },
 
+    getNickRoomStatus: function(nickName, room) {
+        let baseNick = Polari.util_get_basenick(nickName);
+
+        this._ensureRoomMappingForRoom(room);
+
+        let contacts = this._roomMapping.get(room)._contactMapping.get(baseNick) || [];
+        return contacts.length == 0 ? Tp.ConnectionPresenceType.OFFLINE
+                                    : Tp.ConnectionPresenceType.AVAILABLE;
+    },
+
     lookupContact: function(nickName) {
         let baseNick = Polari.util_get_basenick(nickName);
 
@@ -284,17 +294,6 @@ const UserTracker = new Lang.Class({
         return contacts[0];
     },
 
-    /* Nit: It would make sense to move that up right below getNickStatus() */
-    getNickRoomStatus: function(nickName, room) {
-        let baseNick = Polari.util_get_basenick(nickName);
-
-        this._ensureRoomMappingForRoom(room);
-
-        let contacts = this._roomMapping.get(room)._contactMapping.get(baseNick) || [];
-        return contacts.length == 0 ? Tp.ConnectionPresenceType.OFFLINE
-                                    : Tp.ConnectionPresenceType.AVAILABLE;
-    },
-
     /* Not sure about that name, it sounds a bit googley/big brother;
      * maybe watchUserStatus()? But then, the user is optional and the
      * room is not afaics, so maybe use watchRoomStatus() instead?


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