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

Support reading custom status messages

Part of https://github.com/vector-im/riot-web/issues/1528
This commit is contained in:
Travis Ralston
2018-12-11 21:41:15 -07:00
parent c723b76138
commit 848e6e5897
3 changed files with 34 additions and 0 deletions

View File

@@ -1172,6 +1172,16 @@ SyncApi.prototype._processSyncResponse = async function(
if (e.isState() && e.getType() == "m.room.encryption" && self.opts.crypto) {
await self.opts.crypto.onCryptoEvent(e);
}
if (e.isState() && e.getType() === "im.vector.user_status") {
let user = client.store.getUser(e.getStateKey());
if (user) {
user.updateStatusMessage(e);
} else {
user = createNewUser(client, e.getStateKey());
user.updateStatusMessage(e);
client.store.storeUser(user);
}
}
}
await Promise.mapSeries(stateEvents, processRoomEvent);