1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-12-01 04:43:29 +03:00

Add more events to User

There was no way of observing changes to fields like currentlyActive, so add this and add one for lastPresenceTs that will be fired whenever we get a presence event.
This commit is contained in:
David Baker
2016-07-14 09:38:50 +01:00
parent cee9a954ec
commit ecb31b5aaf
2 changed files with 35 additions and 4 deletions

View File

@@ -1040,7 +1040,10 @@ SyncApi.prototype._onOnline = function() {
function createNewUser(client, userId) {
var user = new User(userId);
reEmit(client, user, ["User.avatarUrl", "User.displayName", "User.presence"]);
reEmit(client, user, [
"User.avatarUrl", "User.displayName", "User.presence",
"User.currentlyActive", "User.lastPresenceTs"
]);
return user;
}