refactor: Key manager megolm handling to make key generation more efficient
This commit is contained in:
parent
dd7cf5c1bf
commit
c66d2edb5e
|
|
@ -382,6 +382,15 @@ class KeyManager {
|
|||
.where((e) => !e.value)
|
||||
.map((e) => e.key))
|
||||
: <String>{};
|
||||
|
||||
// check if a device got removed
|
||||
if (oldDeviceIds.difference(newDeviceIds).isNotEmpty) {
|
||||
print("Device deleted, rotating megolm session");
|
||||
wipe = true;
|
||||
break;
|
||||
}
|
||||
|
||||
// check if any new devices need keys
|
||||
final newDevices = newDeviceIds.difference(oldDeviceIds);
|
||||
if (newDeviceIds.isNotEmpty) {
|
||||
devicesToReceive.addAll(newDeviceKeys.where(
|
||||
|
|
|
|||
Loading…
Reference in New Issue