summary refs log tree commit diff
path: root/webclient
diff options
context:
space:
mode:
authorEmmanuel ROHEE <erohee@amdocs.com>2014-09-09 16:10:07 +0200
committerEmmanuel ROHEE <erohee@amdocs.com>2014-09-09 16:10:20 +0200
commit5132fcdb8bd4dc58fb6dcfb9b0f386a8c9808ac1 (patch)
tree5582423c80f7aeea49a9c2abe6da3cd680c81a54 /webclient
parentBF: prevent joined messages to be displayed twice when joining a room. (diff)
downloadsynapse-5132fcdb8bd4dc58fb6dcfb9b0f386a8c9808ac1.tar.xz
Made recents list display something when joining a room which we do not have state data yet
Diffstat (limited to '')
-rw-r--r--webclient/recents/recents-controller.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/webclient/recents/recents-controller.js b/webclient/recents/recents-controller.js
index efa5160c01..9fe369828b 100644
--- a/webclient/recents/recents-controller.js
+++ b/webclient/recents/recents-controller.js
@@ -43,6 +43,14 @@ angular.module('RecentsController', ['matrixService', 'matrixFilter', 'eventHand
         // Refresh the list on matrix invitation and message event
         $rootScope.$on(eventHandlerService.MEMBER_EVENT, function(ngEvent, event, isLive) {
             if (isLive) {
+                if (!$rootScope.rooms[event.room_id]) {
+                    // The user has joined a new room, which we do not have data yet. The reason is that
+                    // the room has appeared in the scope of the user rooms after the global initialSync
+                    // FIXME: an initialSync on this specific room should be done
+                    $rootScope.rooms[event.room_id] = {
+                        room_id:event.room_id
+                    };
+                }
                 $rootScope.rooms[event.room_id].lastMsg = event;
             }
         });