Room fix block devices

This commit is contained in:
Christian Pauly 2020-02-27 08:52:45 +00:00
parent 7c7f2a3dd8
commit 202f997320

View file

@ -95,7 +95,7 @@ class Room {
List<DeviceKeys> deviceKeys = await getUserDeviceKeys();
_outboundGroupSessionDevices = [];
for (DeviceKeys keys in deviceKeys) {
_outboundGroupSessionDevices.add(keys.deviceId);
if (!keys.blocked) _outboundGroupSessionDevices.add(keys.deviceId);
}
_outboundGroupSessionDevices.sort();
try {
@ -148,7 +148,7 @@ class Room {
List<DeviceKeys> deviceKeys = await getUserDeviceKeys();
List<String> outboundGroupSessionDevices = [];
for (DeviceKeys keys in deviceKeys) {
outboundGroupSessionDevices.add(keys.deviceId);
if (!keys.blocked) outboundGroupSessionDevices.add(keys.deviceId);
}
outboundGroupSessionDevices.sort();
if (outboundGroupSessionDevices.toString() ==
@ -160,6 +160,9 @@ class Room {
await client.storeAPI?.setItem(
"/clients/${client.deviceID}/rooms/${this.id}/outbound_group_session",
null);
await client.storeAPI?.setItem(
"/clients/${client.deviceID}/rooms/${this.id}/outbound_group_session_devices",
null);
this._outboundGroupSession?.free();
this._outboundGroupSession = null;
return true;