1
0
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:
David Baker
2018-11-13 12:15:33 +00:00
parent 231fde219c
commit 6c413bba48
2 changed files with 9 additions and 1 deletions

View File

@@ -433,7 +433,15 @@ MegolmEncryption.prototype.reshareKeyWithDevice = async function(
}
// 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];
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
// have been ratcheted to the next chain index.