From 38b5260e484bd2f84bfea01b30706b9efb4b9188 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Sat, 15 Feb 2020 10:30:46 +0100 Subject: [PATCH] Fix encryptionEnabled check --- lib/components/matrix.dart | 5 ----- lib/views/chat_encryption_settings.dart | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/components/matrix.dart b/lib/components/matrix.dart index d6d4b6a..ad3ca9a 100644 --- a/lib/components/matrix.dart +++ b/lib/components/matrix.dart @@ -97,11 +97,6 @@ class MatrixState extends State { hideLoadingDialog() => Navigator.of(_loadingDialogContext)?.pop(); - bool get encryptionEnabled => - client.userDeviceKeys.containsKey(client.userID) && - client.userDeviceKeys[client.userID].deviceKeys - .containsKey(client.deviceID); - Future downloadAndSaveContent(MxContent content, {int width, int height, ThumbnailMethod method}) async { final bool thumbnail = width == null && height == null ? false : true; diff --git a/lib/views/chat_encryption_settings.dart b/lib/views/chat_encryption_settings.dart index 612b033..4bbb1d6 100644 --- a/lib/views/chat_encryption_settings.dart +++ b/lib/views/chat_encryption_settings.dart @@ -64,7 +64,7 @@ class _ChatEncryptionSettingsState extends State { color: room.encrypted ? Colors.green : Colors.red), onTap: () { if (room.encrypted) return; - if (!Matrix.of(context).encryptionEnabled) { + if (!room.client.encryptionEnabled) { Toast.show(I18n.of(context).needPantalaimonWarning, context, duration: 8); return; @@ -84,7 +84,7 @@ class _ChatEncryptionSettingsState extends State { ListTile( trailing: Icon(Icons.info), subtitle: Text( - Matrix.of(context).encryptionEnabled + room.client.encryptionEnabled ? I18n.of(context).warningEncryptionInBeta : I18n.of(context).needPantalaimonWarning, ),