0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-11-02 12:48:57 +01:00

BF: Do not be polluted by ops events that come when paginating back

This commit is contained in:
Emmanuel ROHEE 2014-09-03 15:00:04 +02:00
parent b1195c125f
commit 4777c1cd5b

View file

@ -108,8 +108,11 @@ angular.module('eventHandlerService', [])
var handlePowerLevels = function(event, isLiveEvent) { var handlePowerLevels = function(event, isLiveEvent) {
initRoom(event.room_id); initRoom(event.room_id);
// 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.events.rooms[event.room_id][event.type] = event;
$rootScope.$broadcast(POWERLEVEL_EVENT, event, isLiveEvent); $rootScope.$broadcast(POWERLEVEL_EVENT, event, isLiveEvent);
}
}; };
var handleCallEvent = function(event, isLiveEvent) { var handleCallEvent = function(event, isLiveEvent) {