1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

track lastPresenceTs

This commit is contained in:
Matthew Hodgson
2016-04-18 01:25:16 +01:00
parent dbc3a9a500
commit a2aed99f56
2 changed files with 19 additions and 1 deletions

View File

@@ -609,6 +609,7 @@ Room.prototype._addEventToTimeline = function(event, timeline, toStartOfTimeline
* @private
*/
Room.prototype._addLiveEvents = function(events) {
// var now = Date.now();
for (var i = 0; i < events.length; i++) {
if (events[i].getType() === "m.room.redaction") {
var redactId = events[i].event.redacts;
@@ -652,6 +653,16 @@ Room.prototype._addLiveEvents = function(events) {
this.addReceipt(synthesizeReceipt(
events[i].sender.userId, events[i], "m.read"
), true);
// also, any live events from a user should be taken as implicit
// presence information: evidence that they are currently active.
// ...except in a world where we use 'user.currentlyActive' to reduce
// presence spam, this isn't very useful - we'll get a transition when
// they are no longer currently active anyway. so comment it out for now.
// var user = this.currentState.getMember(events[i].sender.userId);
// user.lastActiveAgo = 0;
// user.lastPresenceTs = now;
}
}
};