fix: Messages being encrypted for too many devices
This commit is contained in:
parent
ae79af6ea8
commit
74bd1d331b
|
@ -1579,13 +1579,13 @@ sort order of ${prevState.sortOrder}. This should never happen...''');
|
|||
/// you can safely make this Client instance null.
|
||||
Future<void> dispose({bool closeDatabase = false}) async {
|
||||
_disposed = true;
|
||||
encryption?.dispose();
|
||||
encryption = null;
|
||||
try {
|
||||
await _currentTransaction;
|
||||
} catch (_) {
|
||||
// No-OP
|
||||
}
|
||||
encryption?.dispose();
|
||||
encryption = null;
|
||||
try {
|
||||
if (closeDatabase) await database?.close();
|
||||
} catch (error, stacktrace) {
|
||||
|
|
|
@ -1620,7 +1620,8 @@ class Room {
|
|||
var deviceKeys = <DeviceKeys>[];
|
||||
var users = await requestParticipants();
|
||||
for (final user in users) {
|
||||
if (client.userDeviceKeys.containsKey(user.id)) {
|
||||
if ([Membership.invite, Membership.join].contains(user.membership) &&
|
||||
client.userDeviceKeys.containsKey(user.id)) {
|
||||
for (var deviceKeyEntry
|
||||
in client.userDeviceKeys[user.id].deviceKeys.values) {
|
||||
deviceKeys.add(deviceKeyEntry);
|
||||
|
|
|
@ -133,7 +133,7 @@ void main() {
|
|||
expect(user1.canChangePowerLevel, false);
|
||||
});
|
||||
test('dispose client', () async {
|
||||
await client.dispose();
|
||||
await client.dispose(closeDatabase: true);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue