Prevent m.relates_to to be removed from the status=1 object in encrypted rooms

This commit is contained in:
Sorunome 2020-07-29 11:43:27 +02:00
parent a28ab5fc60
commit 6915781e6a
No known key found for this signature in database
GPG key ID: B19471D07FC9BE9C

View file

@ -267,6 +267,9 @@ class Encryption {
if (sess == null) { if (sess == null) {
throw ('Unable to create new outbound group session'); 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<String, dynamic>.from(payload);
final Map<String, dynamic> mRelatesTo = payload.remove('m.relates_to'); final Map<String, dynamic> mRelatesTo = payload.remove('m.relates_to');
final payloadContent = { final payloadContent = {
'content': payload, 'content': payload,