aboutsummaryrefslogtreecommitdiff
path: root/lib/events/roommessageevent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/events/roommessageevent.cpp')
-rw-r--r--lib/events/roommessageevent.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/events/roommessageevent.cpp b/lib/events/roommessageevent.cpp
index 078ae70a..616a034f 100644
--- a/lib/events/roommessageevent.cpp
+++ b/lib/events/roommessageevent.cpp
@@ -120,9 +120,11 @@ QJsonObject RoomMessageEvent::assembleContentJson(const QString& plainBody,
if (textContent->relatesTo->type == RelatesTo::ReplacementTypeId()) {
auto newContentJson = json.take("m.new_content"_ls).toObject();
newContentJson.insert(BodyKey, plainBody);
- newContentJson.insert(TypeKey, jsonMsgType);
+ newContentJson.insert(MsgTypeKeyL, jsonMsgType);
json.insert(QStringLiteral("m.new_content"), newContentJson);
+ json[MsgTypeKeyL] = jsonMsgType;
json[BodyKeyL] = "* " + plainBody;
+ return json;
}
}
}
@@ -336,7 +338,7 @@ void TextContent::fillJson(QJsonObject* json) const
}
if (relatesTo) {
json->insert(QStringLiteral("m.relates_to"),
- QJsonObject { { relatesTo->type, relatesTo->eventId } });
+ QJsonObject { { "rel_type", relatesTo->type }, { EventIdKey, relatesTo->eventId } });
if (relatesTo->type == RelatesTo::ReplacementTypeId()) {
QJsonObject newContentJson;
if (mimeType.inherits("text/html")) {