summary refs log tree commit diff
path: root/webclient/room/room-controller.js
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/room/room-controller.js
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/room/room-controller.js')
-rw-r--r--webclient/room/room-controller.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js
index a0485e84e8..e204a27e04 100644
--- a/webclient/room/room-controller.js
+++ b/webclient/room/room-controller.js
@@ -15,8 +15,8 @@ limitations under the License.
 */
 
 angular.module('RoomController', ['ngSanitize', 'mUtilities'])
-.controller('RoomController', ['$scope', '$http', '$timeout', '$routeParams', '$location', 'matrixService', 'eventStreamService', 'eventHandlerService', 'mFileUpload', 'mUtilities',
-                               function($scope, $http, $timeout, $routeParams, $location, matrixService, eventStreamService, eventHandlerService, mFileUpload, mUtilities) {
+.controller('RoomController', ['$scope', '$http', '$timeout', '$routeParams', '$location', 'matrixService', 'eventStreamService', 'eventHandlerService', 'mFileUpload', 'mUtilities', '$rootScope',
+                               function($scope, $http, $timeout, $routeParams, $location, matrixService, eventStreamService, eventHandlerService, mFileUpload, mUtilities, $rootScope) {
    'use strict';
     var MESSAGES_PER_PAGINATION = 30;
     var THUMBNAIL_SIZE = 320;
@@ -199,6 +199,10 @@ angular.module('RoomController', ['ngSanitize', 'mUtilities'])
                 );
             });
 */            
+
+            if (chunk.target_user_id in $rootScope.presence) {
+                updatePresence($rootScope.presence[chunk.target_user_id]);
+            }
         }
         else {
             // selectively update membership else it will nuke the picture and displayname too :/
@@ -265,7 +269,7 @@ angular.module('RoomController', ['ngSanitize', 'mUtilities'])
 
     $scope.onInit = function() {
         console.log("onInit");
-        
+
         // Does the room ID provided in the URL?
         var room_id_or_alias;
         if ($routeParams.room_id_or_alias) {