Merge branch 'room-fix-block-devices' into 'master'

Room fix block devices

See merge request famedly/famedlysdk!229
This commit is contained in:
Christian Pauly 2020-02-27 08:52:45 +00:00
commit b9f0fe2dcf

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;