summary refs log tree commit diff
path: root/webclient/components
diff options
context:
space:
mode:
authorEmmanuel ROHEE <erohee@amdocs.com>2014-09-10 16:26:11 +0200
committerEmmanuel ROHEE <erohee@amdocs.com>2014-09-10 16:26:11 +0200
commit30bfa911fc4de7c2c23ec9c8f7975e4e60e96ebb (patch)
treec264eff1290926785e9e958902e102b242a45994 /webclient/components
parentRemoved wrong comments about recents-controller.js: it uses $rootScope.rooms ... (diff)
downloadsynapse-30bfa911fc4de7c2c23ec9c8f7975e4e60e96ebb.tar.xz
Member event: store use the the latest one
Diffstat (limited to 'webclient/components')
-rw-r--r--webclient/components/matrix/event-handler-service.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/webclient/components/matrix/event-handler-service.js b/webclient/components/matrix/event-handler-service.js
index 80a15182ae..38b7bd6b6d 100644
--- a/webclient/components/matrix/event-handler-service.js
+++ b/webclient/components/matrix/event-handler-service.js
@@ -129,8 +129,13 @@ angular.module('eventHandlerService', [])
             }
         }
         
-        $rootScope.events.rooms[event.room_id].members[event.state_key] = event;
-        $rootScope.$broadcast(MEMBER_EVENT, event, isLiveEvent);
+        // Use data from state event or the latest data from the stream.
+        // Do not care of events that come when paginating back
+        if (isStateEvent || isLiveEvent) {
+            $rootScope.events.rooms[event.room_id].members[event.state_key] = event;
+        }
+        
+        $rootScope.$broadcast(MEMBER_EVENT, event, isLiveEvent, isStateEvent);
     };
     
     var handlePresence = function(event, isLiveEvent) {