mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-04 15:05:05 -04:00
Prevent EventStreamService from knowing too much about the EventHandlerService by changing the contract to just be a single initialSync response callback. Leave it up the handler to deal with splitting out information from /initialSync.
This commit is contained in:
parent
f21960ec9d
commit
5ab9929cbb
2 changed files with 20 additions and 21 deletions
|
@ -613,9 +613,27 @@ function(matrixService, $rootScope, $q, $timeout, mPresence, notificationService
|
|||
}
|
||||
},
|
||||
|
||||
handleInitialSyncDone: function(initialSyncData) {
|
||||
handleInitialSyncDone: function(response) {
|
||||
console.log("# handleInitialSyncDone");
|
||||
initialSyncDeferred.resolve(initialSyncData);
|
||||
|
||||
var rooms = response.data.rooms;
|
||||
for (var i = 0; i < rooms.length; ++i) {
|
||||
var room = rooms[i];
|
||||
|
||||
this.initRoom(room);
|
||||
|
||||
if ("messages" in room) {
|
||||
this.handleRoomMessages(room.room_id, room.messages, false);
|
||||
}
|
||||
|
||||
if ("state" in room) {
|
||||
this.handleEvents(room.state, false, true);
|
||||
}
|
||||
}
|
||||
var presence = response.data.presence;
|
||||
this.handleEvents(presence, false);
|
||||
|
||||
initialSyncDeferred.resolve(response);
|
||||
},
|
||||
|
||||
// Returns a promise that resolves when the initialSync request has been processed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue