Parse /initialSync data and populate the new data structures.

This commit is contained in:
Kegan Dougal 2014-10-31 14:50:31 +00:00
parent 2aa79f4fbe
commit 394f77c3ff
2 changed files with 33 additions and 4 deletions

View file

@ -86,6 +86,18 @@ function(matrixService, $rootScope, $q, $timeout, mPresence, notificationService
}
$rootScope.events.rooms[room_id].membership = room.membership;
}
// =========================================
var __room = modelService.getRoom(room_id);
if (room) { // /initialSync data
__room.current_room_state.storeStateEvents(room.state);
__room.current_room_state.pagination_token = room.messages.end;
__room.old_room_state.storeStateEvents(room.state);
__room.old_room_state.pagination_token = room.messages.start;
__room.addMessages(room.messages.chunk);
}
};
var resetRoomMessages = function(room_id) {