You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-28 05:03:59 +03:00
Clean up a codepath that was only used for crypto messages
Transmission of encrypted messages was happening somewhat differently to normal messages. In particular, we weren't copying the 'unsigned' field when we got the remote-echo, which meant the 'sync' code didn't correctly match up the echo with the original. The separate codepath was becoming a thorn in my side, so fix things up to bring it back in line.
This commit is contained in:
@@ -621,8 +621,13 @@ Room.prototype._addLiveEvents = function(events) {
|
||||
this._eventIdToTimeline[events[i].getId()] = existingTimeline;
|
||||
}
|
||||
|
||||
// replace the event source
|
||||
// replace the event source, but preserve the original content
|
||||
// and type in case it was encrypted (we won't be able to
|
||||
// decrypt it, even though we sent it.)
|
||||
var existingSource = existingEvent.event;
|
||||
existingEvent.event = events[i].event;
|
||||
existingEvent.event.content = existingSource.content;
|
||||
existingEvent.event.type = existingSource.type;
|
||||
|
||||
// successfully sent.
|
||||
existingEvent.status = null;
|
||||
|
||||
Reference in New Issue
Block a user