[DevicekeysList] Clear outbound group session on blocking device
This commit is contained in:
parent
67ac01fdc5
commit
5d73f06cd3
|
@ -1,6 +1,7 @@
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
import '../client.dart';
|
import '../client.dart';
|
||||||
|
import '../room.dart';
|
||||||
|
|
||||||
class DeviceKeysList {
|
class DeviceKeysList {
|
||||||
String userId;
|
String userId;
|
||||||
|
@ -55,6 +56,12 @@ class DeviceKeys {
|
||||||
|
|
||||||
Future<void> setBlocked(bool newBlocked, Client client) {
|
Future<void> setBlocked(bool newBlocked, Client client) {
|
||||||
blocked = newBlocked;
|
blocked = newBlocked;
|
||||||
|
for (Room room in client.rooms) {
|
||||||
|
if (!room.encrypted) continue;
|
||||||
|
if (room.getParticipants().indexWhere((u) => u.id == userId) != -1) {
|
||||||
|
room.clearOutboundGroupSession();
|
||||||
|
}
|
||||||
|
}
|
||||||
return client.storeAPI.storeUserDeviceKeys(client.userDeviceKeys);
|
return client.storeAPI.storeUserDeviceKeys(client.userDeviceKeys);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue