summary refs log tree commit diff
diff options
context:
space:
mode:
authorEmmanuel ROHEE <erohee@amdocs.com>2014-09-25 14:46:11 +0200
committerEmmanuel ROHEE <erohee@amdocs.com>2014-09-25 14:46:11 +0200
commitd170fbdb9f7141afe9415c792079d6f9d7965573 (patch)
tree51a15c0bdc504c8a7cce798d24d0f2cd319532fa
parentMerge branch 'turn' into develop (diff)
downloadsynapse-d170fbdb9f7141afe9415c792079d6f9d7965573.tar.xz
BF: Do a pagination when opening a room from an invitation
-rw-r--r--webclient/room/room-controller.js13
1 files changed, 8 insertions, 5 deletions
diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js
index f188d92cea..d8c62c231e 100644
--- a/webclient/room/room-controller.js
+++ b/webclient/room/room-controller.js
@@ -715,13 +715,16 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput'])
                 // The room members is available in the data fetched by initialSync
                 if ($rootScope.events.rooms[$scope.room_id]) {
 
-                    // There is no need to do a 1st pagination (initialSync provided enough to fill a page)
-                    if ($rootScope.events.rooms[$scope.room_id].messages.length) {
-                        $scope.state.first_pagination = false;
+                    var messages = $rootScope.events.rooms[$scope.room_id].messages;
+
+                    if (0 === messages.length
+                    || (1 === messages.length && "m.room.member" === messages[0].type && "invite" === messages[0].content.membership && $scope.state.user_id === messages[0].state_key)) {
+                        // If we just joined a room, we won't have this history from initial sync, so we should try to paginate it anyway    
+                        $scope.state.first_pagination = true;
                     }
                     else {
-                        // except if we just joined a room, we won't have this history from initial sync, so we should try to paginate it anyway                        
-                        $scope.state.first_pagination = true;
+                        // There is no need to do a 1st pagination (initialSync provided enough to fill a page)
+                        $scope.state.first_pagination = false;
                     }
 
                     var members = $rootScope.events.rooms[$scope.room_id].members;