Skip to content
Snippets Groups Projects
Commit 089d1b1b authored by Emmanuel ROHEE's avatar Emmanuel ROHEE
Browse files

Recents update: do not care of events coming from the past (they are fired...

Recents update: do not care of events coming from the past (they are fired when doing pagination of room messages in the past)
parent 9b2cb41d
No related branches found
No related tags found
No related merge requests found
......@@ -29,7 +29,7 @@ angular.module('RecentsController', ['matrixService', 'eventHandlerService'])
// Refresh the list on matrix invitation and message event
$scope.$on(eventHandlerService.MEMBER_EVENT, function(ngEvent, event, isLive) {
var config = matrixService.config();
if (event.state_key === config.user_id && event.content.membership === "invite") {
if (isLive && event.state_key === config.user_id && event.content.membership === "invite") {
console.log("Invited to room " + event.room_id);
// FIXME push membership to top level key to match /im/sync
event.membership = event.content.membership;
......@@ -39,7 +39,9 @@ angular.module('RecentsController', ['matrixService', 'eventHandlerService'])
}
});
$scope.$on(eventHandlerService.MSG_EVENT, function(ngEvent, event, isLive) {
$scope.rooms[event.room_id].lastMsg = event;
if (isLive) {
$scope.rooms[event.room_id].lastMsg = event;
}
});
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment