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

Fix some nulls in relations

parent e9519689
No related branches found
No related tags found
No related merge requests found
Pipeline #305 passed
......@@ -579,13 +579,12 @@ encrypt_group_message(const std::string &room_id, const std::string &device_id,
mtx::common::RelatesTo r_relation;
// relations shouldn't be encrypted...
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");
} else if (body["content"]["m.relates_to"].contains("event_id")) {
r_relation = body["content"]["m.relates_to"];
body["content"].erase("m.relates_to");
if (body["content"].contains("m.relates_to")) {
if (body["content"]["m.relates_to"].contains("m.in_reply_to")) {
relation = body["content"]["m.relates_to"];
} else if (body["content"]["m.relates_to"].contains("event_id")) {
r_relation = body["content"]["m.relates_to"];
}
}
auto payload = olm::client()->encrypt_group_message(session.get(), body.dump());
......
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