don't start key backup operation if not enabled
This commit is contained in:
parent
2b24de838a
commit
d88720a18f
1 changed files with 5 additions and 1 deletions
|
@ -142,9 +142,9 @@ export class RoomEncryption {
|
||||||
if (!missingSessionEvents.length) {
|
if (!missingSessionEvents.length) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// store missing event ids if received from sync
|
||||||
const missingEventsBySession = groupEventsBySession(missingSessionEvents);
|
const missingEventsBySession = groupEventsBySession(missingSessionEvents);
|
||||||
if (source === DecryptionSource.Sync) {
|
if (source === DecryptionSource.Sync) {
|
||||||
// store missing event ids if received from sync
|
|
||||||
await Promise.all(Array.from(missingEventsBySession.values()).map(async group => {
|
await Promise.all(Array.from(missingEventsBySession.values()).map(async group => {
|
||||||
const eventIds = group.events.map(e => e.event_id);
|
const eventIds = group.events.map(e => e.event_id);
|
||||||
return this._megolmDecryption.addMissingKeyEventIds(
|
return this._megolmDecryption.addMissingKeyEventIds(
|
||||||
|
@ -152,6 +152,10 @@ export class RoomEncryption {
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!this._sessionBackup) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
log.wrapDetached("check key backup", async log => {
|
log.wrapDetached("check key backup", async log => {
|
||||||
// if the message came from sync, wait 10s to see if the room key arrives late,
|
// if the message came from sync, wait 10s to see if the room key arrives late,
|
||||||
// and only after that proceed to request from backup
|
// and only after that proceed to request from backup
|
||||||
|
|
Reference in a new issue