1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

Send a cancellation for room key requests (#456)

* Send a cancellation for room key requests

When we receive a room key, cancel any pending requests we have open for that
key.
This commit is contained in:
Richard van der Hoff
2017-06-07 14:00:47 +01:00
committed by GitHub
parent de257b34c0
commit 0371265fea
3 changed files with 161 additions and 1 deletions

View File

@@ -658,6 +658,14 @@ MegolmDecryption.prototype.onRoomKeyEvent = function(event) {
content.session_key, event.getKeysClaimed(),
);
// cancel any outstanding room key requests for this session
this._crypto.cancelRoomKeyRequest({
algorithm: content.algorithm,
room_id: content.room_id,
session_id: content.session_id,
sender_key: senderKey,
});
// have another go at decrypting events sent with this session.
this._retryDecryption(senderKey, sessionId);
};