summary refs log tree commit diff
path: root/webclient/components
diff options
context:
space:
mode:
authorEmmanuel ROHEE <erohee@amdocs.com>2014-09-03 15:00:04 +0200
committerEmmanuel ROHEE <erohee@amdocs.com>2014-09-03 15:00:19 +0200
commit4777c1cd5bfb33c4aa4bcc7d6364339f0c40ef5a (patch)
treee5970394fa3eda413ad51646fcafea579d8e28ee /webclient/components
parenths: Updated synapse.http.client to handle DNSLookupErrors and bail immediately. (diff)
downloadsynapse-4777c1cd5bfb33c4aa4bcc7d6364339f0c40ef5a.tar.xz
BF: Do not be polluted by ops events that come when paginating back
Diffstat (limited to 'webclient/components')
-rw-r--r--webclient/components/matrix/event-handler-service.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/webclient/components/matrix/event-handler-service.js b/webclient/components/matrix/event-handler-service.js
index 908a9fe2b5..7c62cd1b5d 100644
--- a/webclient/components/matrix/event-handler-service.js
+++ b/webclient/components/matrix/event-handler-service.js
@@ -108,8 +108,11 @@ angular.module('eventHandlerService', [])
     var handlePowerLevels = function(event, isLiveEvent) {
         initRoom(event.room_id);
 
-        $rootScope.events.rooms[event.room_id][event.type] = event;
-        $rootScope.$broadcast(POWERLEVEL_EVENT, event, isLiveEvent);
+        // Keep the latest data. Do not care of events that come when paginating back
+        if (!$rootScope.events.rooms[event.room_id][event.type] || isLiveEvent) {
+            $rootScope.events.rooms[event.room_id][event.type] = event;
+            $rootScope.$broadcast(POWERLEVEL_EVENT, event, isLiveEvent);   
+        }
     };
 
     var handleCallEvent = function(event, isLiveEvent) {