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

@ -104,8 +104,10 @@ angular.module('eventStreamService', [])
settings.isActive = true;
var deferred = $q.defer();
// Initial sync: get all information and the last message of all rooms of the user
matrixService.initialSync(1, false).then(
// Initial sync: get all information and the last 30 messages of all rooms of the user
// 30 messages should be enough to display a full page of messages in a room
// without requiring to make an additional request
matrixService.initialSync(30, false).then(
function(response) {
var rooms = response.data.rooms;
for (var i = 0; i < rooms.length; ++i) {