fix: minor stuff

This commit is contained in:
Reza 2022-11-23 19:28:08 +01:00
parent 44f862b966
commit 10cf979877
2 changed files with 6 additions and 5 deletions

View File

@ -639,9 +639,10 @@ class KeyVerification {
await client.sendToDevicesOfUserIds({userId}, type, payload); await client.sendToDevicesOfUserIds({userId}, type, payload);
} else { } else {
final deviceKeys = client.userDeviceKeys[userId]?.deviceKeys; final deviceKeys = client.userDeviceKeys[userId]?.deviceKeys;
deviceKeys?.removeWhere((key, value) => deviceKeys?.removeWhere((key, _) => !verifiedDevices
verifiedDevices.map((e) => e.deviceId).toList().contains(key) == .map((device) => device.deviceId)
false); .toList()
.contains(key));
await client.sendToDeviceEncrypted( await client.sendToDeviceEncrypted(
deviceKeys!.values.toList(), deviceKeys!.values.toList(),
type, type,

View File

@ -70,7 +70,7 @@ class DeviceKeysList {
Future<KeyVerification> startVerification({ Future<KeyVerification> startVerification({
bool? newDirectChatEnableEncryption, bool? newDirectChatEnableEncryption,
List<StateEvent>? newDirectChatInitialState, List<StateEvent>? newDirectChatInitialState,
List<Device>? verifiedDevice, List<Device>? verifiedDevices,
}) async { }) async {
final encryption = client.encryption; final encryption = client.encryption;
if (encryption == null) { if (encryption == null) {
@ -98,7 +98,7 @@ class DeviceKeysList {
final request = KeyVerification( final request = KeyVerification(
encryption: encryption, userId: userId, deviceId: '*'); encryption: encryption, userId: userId, deviceId: '*');
await request.start( await request.start(
verifiedDevices: verifiedDevice, verifiedDevices: verifiedDevices,
); );
encryption.keyVerificationManager.addRequest(request); encryption.keyVerificationManager.addRequest(request);
return request; return request;