1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-18 05:42:00 +03:00

Implicit read receipts

* Inject implicit read receipts into the timeline
 * Twiddle local echo a bit to make the implicit receipts match the various different stages of local echo.
This commit is contained in:
David Baker
2015-11-05 13:39:03 +00:00
parent 904539df58
commit 0da547a239
3 changed files with 51 additions and 6 deletions

View File

@@ -946,6 +946,9 @@ function _sendEvent(client, room, event, callback) {
// the fake event we made above. If we don't find it, we're still
// waiting on the real event and so should assign the fake event
// with the real event_id for matching later.
// FIXME: This manipulation of the room should probably be done
// inside the room class, not by the client.
var matchingEvent = utils.findElement(room.timeline, function(ev) {
return ev.getId() === eventId;
}, true);
@@ -958,13 +961,13 @@ function _sendEvent(client, room, event, callback) {
matchingEvent.event.content = event.event.content;
matchingEvent.event.type = event.event.type;
}
utils.removeElement(room.timeline, function(ev) {
return ev.getId() === event.getId();
}, true);
room.removeEvents([event.getId()]);
}
else {
room.removeEvents([event.getId()]);
event.event.event_id = res.event_id;
event.status = null;
room.addEventsToTimeline([event]);
}
}