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
Fix decryption of events whose key arrives later
Re-fixes https://github.com/vector-im/riot-web/issues/2273. And test it this time.
This commit is contained in:
@@ -595,22 +595,24 @@ MegolmDecryption.prototype._addEventToPendingList = function(event) {
|
||||
MegolmDecryption.prototype.onRoomKeyEvent = function(event) {
|
||||
console.log("Adding key from ", event);
|
||||
const content = event.getContent();
|
||||
const senderKey = event.getSenderKey();
|
||||
|
||||
if (!content.room_id ||
|
||||
!content.session_id ||
|
||||
!content.session_key
|
||||
!content.session_key ||
|
||||
!senderKey
|
||||
) {
|
||||
console.error("key event is missing fields");
|
||||
return;
|
||||
}
|
||||
|
||||
this._olmDevice.addInboundGroupSession(
|
||||
content.room_id, event.getSenderKey(), content.session_id,
|
||||
content.room_id, senderKey, content.session_id,
|
||||
content.session_key, event.getKeysClaimed(),
|
||||
);
|
||||
|
||||
// have another go at decrypting events sent with this session.
|
||||
this._retryDecryption(event.getSenderKey, content.session_id);
|
||||
this._retryDecryption(senderKey, content.session_id);
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user