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
Typo + exit if session was never shared
This commit is contained in:
@@ -433,7 +433,15 @@ MegolmEncryption.prototype.reshareKeyWithDevice = async function(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// The chain index of the key we previously sent this device
|
// The chain index of the key we previously sent this device
|
||||||
|
if (obSessionInfo.sharedWithDevices[userId] === undefined) {
|
||||||
|
logger.debug("Session ID " + sessionId + " never shared with user " + userId);
|
||||||
|
return;
|
||||||
|
}
|
||||||
const sentChainIndex = obSessionInfo.sharedWithDevices[userId][device.deviceId];
|
const sentChainIndex = obSessionInfo.sharedWithDevices[userId][device.deviceId];
|
||||||
|
if (sentChainIndex === undefined) {
|
||||||
|
logger.debug("Session ID " + sessionId + " never shared with device " + userId + ":" + device.deviceId);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// get the key from the inbound session: the outbound one will already
|
// get the key from the inbound session: the outbound one will already
|
||||||
// have been ratcheted to the next chain index.
|
// have been ratcheted to the next chain index.
|
||||||
|
|||||||
@@ -1196,7 +1196,7 @@ Crypto.prototype._onToDeviceBadEncrypted = async function(event) {
|
|||||||
// We send this first such that, as long as the toDevice messages arrive in the
|
// We send this first such that, as long as the toDevice messages arrive in the
|
||||||
// same order we sent them, the other end will get this first, set up the new session,
|
// same order we sent them, the other end will get this first, set up the new session,
|
||||||
// then get the keyshare request and send the key over this new session (because it
|
// then get the keyshare request and send the key over this new session (because it
|
||||||
// it the session it has most recently received a message on).
|
// is the session it has most recently received a message on).
|
||||||
const encryptedContent = {
|
const encryptedContent = {
|
||||||
algorithm: olmlib.OLM_ALGORITHM,
|
algorithm: olmlib.OLM_ALGORITHM,
|
||||||
sender_key: this._olmDevice.deviceCurve25519Key,
|
sender_key: this._olmDevice.deviceCurve25519Key,
|
||||||
|
|||||||
Reference in New Issue
Block a user