mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-23 03:18:49 +03:00
Fix some nulls in relations
This commit is contained in:
parent
e9519689f1
commit
cc9de7f3b0
1 changed files with 6 additions and 7 deletions
|
@ -579,13 +579,12 @@ encrypt_group_message(const std::string &room_id, const std::string &device_id,
|
||||||
mtx::common::RelatesTo r_relation;
|
mtx::common::RelatesTo r_relation;
|
||||||
|
|
||||||
// relations shouldn't be encrypted...
|
// relations shouldn't be encrypted...
|
||||||
if (body["content"].contains("m.relates_to") &&
|
if (body["content"].contains("m.relates_to")) {
|
||||||
body["content"]["m.relates_to"].contains("m.in_reply_to")) {
|
if (body["content"]["m.relates_to"].contains("m.in_reply_to")) {
|
||||||
relation = body["content"]["m.relates_to"];
|
relation = body["content"]["m.relates_to"];
|
||||||
body["content"].erase("m.relates_to");
|
|
||||||
} else if (body["content"]["m.relates_to"].contains("event_id")) {
|
} else if (body["content"]["m.relates_to"].contains("event_id")) {
|
||||||
r_relation = body["content"]["m.relates_to"];
|
r_relation = body["content"]["m.relates_to"];
|
||||||
body["content"].erase("m.relates_to");
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto payload = olm::client()->encrypt_group_message(session.get(), body.dump());
|
auto payload = olm::client()->encrypt_group_message(session.get(), body.dump());
|
||||||
|
|
Loading…
Reference in a new issue