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