Merge pull request #1556 from famedly/nico/fix-owns-encryption-keys

fix: userOwnsEncryptionKeys returns true for empty device lists
This commit is contained in:
Nicolas Werner 2023-09-13 23:11:48 +02:00 committed by GitHub
commit 61c89ae45a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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: []});