1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-28 05:03:59 +03:00

generic account data support

This commit is contained in:
Matthew Hodgson
2016-07-18 01:40:05 +01:00
parent ebd2ef6f95
commit 58a68106bc
4 changed files with 96 additions and 21 deletions

View File

@@ -605,7 +605,19 @@ SyncApi.prototype._processSyncResponse = function(syncToken, data) {
});
}
// the returned json structure is abit crap, so make it into a
// handle non-room account_data
if (data.account_data && utils.isArray(data.account_data.events)) {
client.store.storeAccountDataEvents(
data.account_data.events.map(client.getEventMapper()).map(
function(accountDataEvent) {
client.emit("accountData", accountDataEvent);
return accountDataEvent;
}
)
);
}
// the returned json structure is a bit crap, so make it into a
// nicer form (array) after applying sanity to make sure we don't fail
// on missing keys (on the off chance)
var inviteRooms = [];