fix: userOwnsEncryptionKeys returns true for empty device lists

This commit is contained in:
Nicolas Werner 2023-09-13 14:26:41 +02:00
parent 5370e8cee8
commit 5b47a647b6
No known key found for this signature in database
1 changed files with 1 additions and 1 deletions

View File

@ -743,7 +743,7 @@ class Client extends MatrixApi {
/// server to answer this.
Future<bool> userOwnsEncryptionKeys(String userId) async {
if (userId == userID) return encryptionEnabled;
if (_userDeviceKeys.containsKey(userId)) {
if (_userDeviceKeys[userId]?.deviceKeys.isNotEmpty ?? false) {
return true;
}
final keys = await queryKeys({userId: []});