[Room] Fix relates to key while encryption
This commit is contained in:
parent
a4e75cb6f2
commit
69b13bb24d
|
@ -1668,6 +1668,7 @@ class Room {
|
|||
if (_outboundGroupSession == null) {
|
||||
await createOutboundGroupSession();
|
||||
}
|
||||
final Map<String, dynamic> 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'],
|
||||
|
|
Loading…
Reference in a new issue