summary refs log tree commit diff
path: root/webclient/recents
diff options
context:
space:
mode:
authorEmmanuel ROHEE <erohee@amdocs.com>2014-09-09 16:31:50 +0200
committerEmmanuel ROHEE <erohee@amdocs.com>2014-09-09 16:31:50 +0200
commit746ed57c0e5a2d49388c99ba1a51fca0bc207096 (patch)
tree55abd6b84ce536e27e7e76c3ef9269060424febc /webclient/recents
parentMade recents list display something when joining a room which we do not have ... (diff)
downloadsynapse-746ed57c0e5a2d49388c99ba1a51fca0bc207096.tar.xz
When the user has been kicked or banned from a room, remove the room from his recents list
Diffstat (limited to 'webclient/recents')
-rw-r--r--webclient/recents/recents-controller.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/webclient/recents/recents-controller.js b/webclient/recents/recents-controller.js
index 9fe369828b..0553eb9be0 100644
--- a/webclient/recents/recents-controller.js
+++ b/webclient/recents/recents-controller.js
@@ -51,7 +51,14 @@ angular.module('RecentsController', ['matrixService', 'matrixFilter', 'eventHand
                         room_id:event.room_id
                     };
                 }
-                $rootScope.rooms[event.room_id].lastMsg = event;
+                else if (event.state_key === matrixService.config().user_id && "invite" !== event.membership && "join" !== event.membership) {
+                    // The user has been kicked or banned from the room, remove this room from the recents
+                    delete $rootScope.rooms[event.room_id];
+                }
+                
+                if ($rootScope.rooms[event.room_id]) {
+                    $rootScope.rooms[event.room_id].lastMsg = event;
+                }
             }
         });
         $rootScope.$on(eventHandlerService.MSG_EVENT, function(ngEvent, event, isLive) {