summary refs log tree commit diff
path: root/webclient/components
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-08-22 10:50:38 +0100
committerErik Johnston <erik@matrix.org>2014-08-22 10:51:00 +0100
commit6118a102c1f508e7b7a3a0a3fdfb8c7e9c08f144 (patch)
treeca7fec16660f7534401b0c7d008e131fec2fab60 /webclient/components
parentReinitialize room when creating a RoomController so that we start off with a ... (diff)
downloadsynapse-6118a102c1f508e7b7a3a0a3fdfb8c7e9c08f144.tar.xz
Keep track of people's presence and query that when we update the members list.
Diffstat (limited to 'webclient/components')
-rw-r--r--webclient/components/matrix/event-handler-service.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/webclient/components/matrix/event-handler-service.js b/webclient/components/matrix/event-handler-service.js
index aa8867425e..b5eb73d92b 100644
--- a/webclient/components/matrix/event-handler-service.js
+++ b/webclient/components/matrix/event-handler-service.js
@@ -35,6 +35,8 @@ angular.module('eventHandlerService', [])
     $rootScope.events = {
         rooms: {}, // will contain roomId: { messages:[], members:{userid1: event} }
     };
+
+    $rootScope.presence = {};
     
     var initRoom = function(room_id) {
         if (!(room_id in $rootScope.events.rooms)) {
@@ -91,6 +93,7 @@ angular.module('eventHandlerService', [])
     };
     
     var handlePresence = function(event, isLiveEvent) {
+        $rootScope.presence[event.content.user_id] = event;
         $rootScope.$broadcast(PRESENCE_EVENT, event, isLiveEvent);
     };