summary refs log tree commit diff
path: root/webclient/components
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2014-10-31 17:13:27 +0000
committerKegan Dougal <kegan@matrix.org>2014-10-31 17:13:27 +0000
commitf21960ec9d346d53a21369b8179cc30365654517 (patch)
tree7ae51a7880f64fe612a247395861eaa99c99ded7 /webclient/components
parentroom.html now displays messages from model-service. Add debugging fields. Hoo... (diff)
downloadsynapse-f21960ec9d346d53a21369b8179cc30365654517.tar.xz
Replace lots of .events.rooms[room_id] with .room
Diffstat (limited to 'webclient/components')
-rw-r--r--webclient/components/matrix/event-handler-service.js6
-rw-r--r--webclient/components/matrix/model-service.js2
2 files changed, 7 insertions, 1 deletions
diff --git a/webclient/components/matrix/event-handler-service.js b/webclient/components/matrix/event-handler-service.js
index a511b394b8..f8a91ee0ac 100644
--- a/webclient/components/matrix/event-handler-service.js
+++ b/webclient/components/matrix/event-handler-service.js
@@ -289,6 +289,8 @@ function(matrixService, $rootScope, $q, $timeout, mPresence, notificationService
     };
     
     var handleRoomMember = function(event, isLiveEvent, isStateEvent) {
+        var __room = modelService.getRoom(event.room_id);
+        
         
         // add membership changes as if they were a room message if something interesting changed
         // Exception: Do not do this if the event is a room state event because such events already come
@@ -317,6 +319,9 @@ function(matrixService, $rootScope, $q, $timeout, mPresence, notificationService
                 else {
                     $rootScope.events.rooms[event.room_id].messages.unshift(event);
                 }
+                // ============
+                
+                __room.addMessageEvent(event, !isLiveEvent);
             }
         }
         
@@ -324,6 +329,7 @@ function(matrixService, $rootScope, $q, $timeout, mPresence, notificationService
         // Do not care of events that come when paginating back
         if (isStateEvent || isLiveEvent) {
             $rootScope.events.rooms[event.room_id].members[event.state_key] = event;
+            __room.current_room_state.members[event.state_key] = event;
         }
         
         $rootScope.$broadcast(MEMBER_EVENT, event, isLiveEvent, isStateEvent);
diff --git a/webclient/components/matrix/model-service.js b/webclient/components/matrix/model-service.js
index d47ac6b2a9..6167a84c62 100644
--- a/webclient/components/matrix/model-service.js
+++ b/webclient/components/matrix/model-service.js
@@ -77,7 +77,7 @@ angular.module('modelService', [])
     /***** Room State Object *****/
     var RoomState = function RoomState() {
         // list of RoomMember
-        this.members = []; 
+        this.members = {}; 
         // state events, the key is a compound of event type + state_key
         this.state_events = {}; 
         this.pagination_token = "";