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

BF: Do a pagination when opening a room from an invitation

parent c58eb0d5
No related branches found
No related tags found
No related merge requests found
...@@ -715,13 +715,16 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) ...@@ -715,13 +715,16 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput'])
// The room members is available in the data fetched by initialSync // The room members is available in the data fetched by initialSync
if ($rootScope.events.rooms[$scope.room_id]) { if ($rootScope.events.rooms[$scope.room_id]) {
// There is no need to do a 1st pagination (initialSync provided enough to fill a page) var messages = $rootScope.events.rooms[$scope.room_id].messages;
if ($rootScope.events.rooms[$scope.room_id].messages.length) {
$scope.state.first_pagination = false; 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 { 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 // There is no need to do a 1st pagination (initialSync provided enough to fill a page)
$scope.state.first_pagination = true; $scope.state.first_pagination = false;
} }
var members = $rootScope.events.rooms[$scope.room_id].members; var members = $rootScope.events.rooms[$scope.room_id].members;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment