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

Merge pull request #41 from matrix-org/implicit_read_receipts

Implicit read receipts
This commit is contained in:
David Baker
2015-11-05 14:42:48 +00:00
3 changed files with 55 additions and 6 deletions

View File

@@ -954,6 +954,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);
@@ -966,13 +969,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]);
}
}