You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-09-01 21:21:58 +03:00
Add User.getLastModifiedTime()
This commit is contained in:
@@ -29,6 +29,7 @@ function User(userId) {
|
|||||||
presence: null,
|
presence: null,
|
||||||
profile: null
|
profile: null
|
||||||
};
|
};
|
||||||
|
this._updateModifiedTime();
|
||||||
}
|
}
|
||||||
utils.inherits(User, EventEmitter);
|
utils.inherits(User, EventEmitter);
|
||||||
|
|
||||||
@@ -64,11 +65,23 @@ User.prototype.setPresenceEvent = function(event) {
|
|||||||
this.avatarUrl = event.getContent().avatar_url;
|
this.avatarUrl = event.getContent().avatar_url;
|
||||||
this.lastActiveAgo = event.getContent().last_active_ago;
|
this.lastActiveAgo = event.getContent().last_active_ago;
|
||||||
|
|
||||||
|
if (eventsToFire.length > 0) {
|
||||||
|
this._updateModifiedTime();
|
||||||
|
}
|
||||||
|
|
||||||
for (var i = 0; i < eventsToFire.length; i++) {
|
for (var i = 0; i < eventsToFire.length; i++) {
|
||||||
this.emit(eventsToFire[i], event, this);
|
this.emit(eventsToFire[i], event, this);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
User.prototype._updateModifiedTime = function() {
|
||||||
|
this._modified = Date.now();
|
||||||
|
};
|
||||||
|
|
||||||
|
User.prototype.getLastModifiedTime = function() {
|
||||||
|
return this._modified;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The User class.
|
* The User class.
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user