summary refs log tree commit diff
diff options
context:
space:
mode:
authorEmmanuel ROHEE <erohee@amdocs.com>2014-08-29 09:55:47 +0200
committerEmmanuel ROHEE <erohee@amdocs.com>2014-08-29 09:55:47 +0200
commit089d1b1b78f4d98afbe1eee070da5e4ad20d6664 (patch)
tree1b04d6beb5aad8a0608387592cf027220f1d216c
parentDisplay emotes in the recents list (diff)
downloadsynapse-089d1b1b78f4d98afbe1eee070da5e4ad20d6664.tar.xz
Recents update: do not care of events coming from the past (they are fired when doing pagination of room messages in the past)
Diffstat (limited to '')
-rw-r--r--webclient/recents/recents-controller.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/webclient/recents/recents-controller.js b/webclient/recents/recents-controller.js
index 1ead08cae8..d33d41a922 100644
--- a/webclient/recents/recents-controller.js
+++ b/webclient/recents/recents-controller.js
@@ -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;              
+            }
         });
     };