From fe2d184fafd3ac485ce1bb6d3f7e5da0728216ca Mon Sep 17 00:00:00 2001 From: Krille Fear Date: Sun, 28 Nov 2021 10:37:56 +0100 Subject: [PATCH] fix: userOwnsEncryptionKeys always returns true Actually the homeserver sends an empty object in the deviceKeys map so we need to check if this object is there but is empty. --- lib/src/client.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/client.dart b/lib/src/client.dart index bbf881a6..0aa483f5 100644 --- a/lib/src/client.dart +++ b/lib/src/client.dart @@ -650,7 +650,7 @@ class Client extends MatrixApi { return true; } final keys = await queryKeys({userId: []}); - return keys.deviceKeys?.isNotEmpty ?? false; + return keys.deviceKeys?[userId]?.isNotEmpty ?? false; } /// Creates a new space and returns the Room ID. The parameters are mostly