Skip to content
Snippets Groups Projects
Commit c973fd75 authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Fix m.relates_to being sent as 'null' when not set in encrypted messages.

Thank you Sorunome for reporting.
parent cded494c
No related branches found
Tags nightly
No related merge requests found
......@@ -168,7 +168,8 @@ encrypt_group_message(const std::string &room_id, const std::string &device_id,
// relations shouldn't be encrypted...
mtx::common::ReplyRelatesTo relation;
if (body["content"]["m.relates_to"].contains("m.in_reply_to")) {
if (body["content"].contains("m.relates_to") &&
body["content"]["m.relates_to"].contains("m.in_reply_to")) {
relation = body["content"]["m.relates_to"];
body["content"].erase("m.relates_to");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment