diff --git a/CHANGELOG.md b/CHANGELOG.md index 0adbdd16..67732a45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## [0.15.9] - 14th Dec 2022 +- refactor: Key manager megolm handling to make key generation more efficient + ## [0.15.8] - 12th Dec 2022 - fix: leaved direct chat name (Reza) diff --git a/lib/encryption/key_manager.dart b/lib/encryption/key_manager.dart index 786a76b5..56b2485a 100644 --- a/lib/encryption/key_manager.dart +++ b/lib/encryption/key_manager.dart @@ -382,6 +382,14 @@ class KeyManager { .where((e) => !e.value) .map((e) => e.key)) : {}; + + // check if a device got removed + if (oldDeviceIds.difference(newDeviceIds).isNotEmpty) { + wipe = true; + break; + } + + // check if any new devices need keys final newDevices = newDeviceIds.difference(oldDeviceIds); if (newDeviceIds.isNotEmpty) { devicesToReceive.addAll(newDeviceKeys.where( diff --git a/pubspec.yaml b/pubspec.yaml index f824cafb..ecd3a16f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: matrix description: Matrix Dart SDK -version: 0.15.8 +version: 0.15.9 homepage: https://famedly.com repository: https://gitlab.com/famedly/company/frontend/famedlysdk.git