diff --git a/lib/src/room.dart b/lib/src/room.dart index a87f88e..856dc64 100644 --- a/lib/src/room.dart +++ b/lib/src/room.dart @@ -1668,6 +1668,7 @@ class Room { if (_outboundGroupSession == null) { await createOutboundGroupSession(); } + final Map mRelatesTo = payload.remove('m.relates_to'); final payloadContent = { 'content': payload, 'type': type, @@ -1679,6 +1680,7 @@ class Room { 'device_id': client.deviceID, 'sender_key': client.identityKey, 'session_id': _outboundGroupSession.session_id(), + if (mRelatesTo != null) 'm.relates_to': mRelatesTo, }; await _storeOutboundGroupSession(); return encryptedPayload; @@ -1736,6 +1738,10 @@ class Room { }; } } + if (event.content['m.relates_to'] != null) { + decryptedPayload['content']['m.relates_to'] = + event.content['m.relates_to']; + } return Event( content: decryptedPayload['content'], typeKey: decryptedPayload['type'],