[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) {
|
if (_outboundGroupSession == null) {
|
||||||
await createOutboundGroupSession();
|
await createOutboundGroupSession();
|
||||||
}
|
}
|
||||||
|
final Map<String, dynamic> mRelatesTo = payload.remove('m.relates_to');
|
||||||
final payloadContent = {
|
final payloadContent = {
|
||||||
'content': payload,
|
'content': payload,
|
||||||
'type': type,
|
'type': type,
|
||||||
|
@ -1679,6 +1680,7 @@ class Room {
|
||||||
'device_id': client.deviceID,
|
'device_id': client.deviceID,
|
||||||
'sender_key': client.identityKey,
|
'sender_key': client.identityKey,
|
||||||
'session_id': _outboundGroupSession.session_id(),
|
'session_id': _outboundGroupSession.session_id(),
|
||||||
|
if (mRelatesTo != null) 'm.relates_to': mRelatesTo,
|
||||||
};
|
};
|
||||||
await _storeOutboundGroupSession();
|
await _storeOutboundGroupSession();
|
||||||
return encryptedPayload;
|
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(
|
return Event(
|
||||||
content: decryptedPayload['content'],
|
content: decryptedPayload['content'],
|
||||||
typeKey: decryptedPayload['type'],
|
typeKey: decryptedPayload['type'],
|
||||||
|
|
Loading…
Reference in a new issue