You've already forked matrix-js-sdk
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user