From 6915781e6a19fe318cfa8e13a8b9d859fc9c582d Mon Sep 17 00:00:00 2001 From: Sorunome Date: Wed, 29 Jul 2020 11:43:27 +0200 Subject: [PATCH] Prevent m.relates_to to be removed from the status=1 object in encrypted rooms --- lib/encryption/encryption.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/encryption/encryption.dart b/lib/encryption/encryption.dart index 4470285..62c5a05 100644 --- a/lib/encryption/encryption.dart +++ b/lib/encryption/encryption.dart @@ -267,6 +267,9 @@ class Encryption { if (sess == null) { throw ('Unable to create new outbound group session'); } + // we clone the payload as we do not want to remove 'm.relates_to' from the + // original payload passed into this function + payload = Map.from(payload); final Map mRelatesTo = payload.remove('m.relates_to'); final payloadContent = { 'content': payload,