diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2020-03-19 12:51:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-19 12:51:04 +0100 |
commit | 792dc5dcc8e548030f9246f20a39ef6febee3910 (patch) | |
tree | cd8bd3888f234668784c5cd486e58a4b5b4d404b /lib/events/roommessageevent.cpp | |
parent | 5b7bfc2d559c1707208007f2b7d5c8e898b98f7e (diff) | |
parent | 682f96d4af19226e553138b1a86ed9233c35edbd (diff) | |
download | libquotient-792dc5dcc8e548030f9246f20a39ef6febee3910.tar.gz libquotient-792dc5dcc8e548030f9246f20a39ef6febee3910.zip |
Merge pull request #376 from rpallai/editing-fixes
Simple changes for sending edits
Diffstat (limited to 'lib/events/roommessageevent.cpp')
-rw-r--r-- | lib/events/roommessageevent.cpp | 6 |
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")) { |