From a52fef7c4b6fca09d9ce28618360d415f70aea42 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Wed, 19 Feb 2020 10:59:21 +0100 Subject: [PATCH] [Room] Send unencrypted if encryption not enabled --- lib/src/room.dart | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/src/room.dart b/lib/src/room.dart index dbfd801b..cfd7c791 100644 --- a/lib/src/room.dart +++ b/lib/src/room.dart @@ -1476,8 +1476,7 @@ class Room { Future> encryptGroupMessagePayload( Map payload, {String type = "m.room.message"}) async { - if (!this.encrypted) return payload; - if (!client.encryptionEnabled) throw ("Encryption is not enabled"); + if (!this.encrypted || !client.encryptionEnabled) return payload; if (this.encryptionAlgorithm != "m.megolm.v1.aes-sha2") { throw ("Unknown encryption algorithm"); }