Merge branch 'client-fix-trust-own-device' into 'master'

[Client] Trust own device

See merge request famedly/famedlysdk!191
This commit is contained in:
Christian Pauly 2020-02-15 12:38:06 +00:00
commit 1f5e3d3873

View file

@ -1389,8 +1389,14 @@ class Client {
final String userId = rawDeviceKeyListEntry.key; final String userId = rawDeviceKeyListEntry.key;
_userDeviceKeys[userId].deviceKeys = {}; _userDeviceKeys[userId].deviceKeys = {};
for (final rawDeviceKeyEntry in rawDeviceKeyListEntry.value.entries) { for (final rawDeviceKeyEntry in rawDeviceKeyListEntry.value.entries) {
_userDeviceKeys[userId].deviceKeys[rawDeviceKeyEntry.key] = final String deviceId = rawDeviceKeyEntry.key;
_userDeviceKeys[userId].deviceKeys[deviceId] =
DeviceKeys.fromJson(rawDeviceKeyEntry.value); DeviceKeys.fromJson(rawDeviceKeyEntry.value);
if (deviceId == this.deviceID &&
_userDeviceKeys[userId].deviceKeys[deviceId].ed25519Key ==
this.fingerprintKey) {
_userDeviceKeys[userId].deviceKeys[deviceId].verified = true;
}
} }
_userDeviceKeys[userId].outdated = false; _userDeviceKeys[userId].outdated = false;
} }