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"); }