WEB-29: Improve room page content loading

InitialSync: load the 30 last messages of each room so that a full page of messages can be displayed without additionnal request
This commit is contained in:
Emmanuel ROHEE 2014-09-16 15:03:07 +02:00
parent f4094c5eb3
commit 45592ccdfd
3 changed files with 26 additions and 8 deletions

View file

@ -235,7 +235,7 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput'])
matrixService.paginateBackMessages($scope.room_id, $rootScope.events.rooms[$scope.room_id].pagination.earliest_token, numItems).then(
function(response) {
eventHandlerService.handleRoomMessages($scope.room_id, response.data, false);
eventHandlerService.handleRoomMessages($scope.room_id, response.data, false, 'b');
if (response.data.chunk.length < MESSAGES_PER_PAGINATION) {
// no more messages to paginate. this currently never gets turned true again, as we never
// expire paginated contents in the current implementation.