summary refs log tree commit diff
path: root/src/Olm.cpp
diff options
context:
space:
mode:
authorJoseph Donofry <joedonofry@gmail.com>2021-01-11 17:51:39 -0500
committerJoseph Donofry <joedonofry@gmail.com>2021-01-11 17:51:39 -0500
commit3ff8b3ad8c015d45a515ca381691cae43fc32a00 (patch)
treeedec1d1e7926d9c0e0beb68ca604cc6bcdc1ebf6 /src/Olm.cpp
parentAdd Ripple effects to qml buttons and avatar (diff)
parentMerge pull request #372 from deepbluev7/fix-pr-CI (diff)
downloadnheko-3ff8b3ad8c015d45a515ca381691cae43fc32a00.tar.xz
Merge master and fix conflicts
Diffstat (limited to 'src/Olm.cpp')
-rw-r--r--src/Olm.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/Olm.cpp b/src/Olm.cpp

index 07fc49f6..fe789560 100644 --- a/src/Olm.cpp +++ b/src/Olm.cpp
@@ -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());