From 2c14af9a8b30b89b87afc3f197b8808fb09d12b3 Mon Sep 17 00:00:00 2001 From: Krille Date: Wed, 3 May 2023 13:00:00 +0200 Subject: [PATCH] fix: Reactions are sent encrypted --- lib/encryption/encryption.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/encryption/encryption.dart b/lib/encryption/encryption.dart index 2c15485a..c46a36aa 100644 --- a/lib/encryption/encryption.dart +++ b/lib/encryption/encryption.dart @@ -354,8 +354,9 @@ class Encryption { Future> encryptGroupMessagePayload( String roomId, Map payload, {String type = EventTypes.Message}) async { - final Map? mRelatesTo = - Map.from(payload).remove('m.relates_to'); + payload = copyMap(payload); + final Map? mRelatesTo = payload.remove('m.relates_to'); + // Events which only contain a m.relates_to like reactions don't need to // be encrypted. if (payload.isEmpty && mRelatesTo != null) {