diff options
author | Emmanuel ROHEE <erohee@amdocs.com> | 2014-09-03 15:00:04 +0200 |
---|---|---|
committer | Emmanuel ROHEE <erohee@amdocs.com> | 2014-09-03 15:00:19 +0200 |
commit | 4777c1cd5bfb33c4aa4bcc7d6364339f0c40ef5a (patch) | |
tree | e5970394fa3eda413ad51646fcafea579d8e28ee /webclient | |
parent | hs: Updated synapse.http.client to handle DNSLookupErrors and bail immediately. (diff) | |
download | synapse-4777c1cd5bfb33c4aa4bcc7d6364339f0c40ef5a.tar.xz |
BF: Do not be polluted by ops events that come when paginating back
Diffstat (limited to 'webclient')
-rw-r--r-- | webclient/components/matrix/event-handler-service.js | 7 |
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) { |