aboutsummaryrefslogtreecommitdiff
path: root/lib/events
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2021-01-28 16:50:49 +0100
committerGitHub <noreply@github.com>2021-01-28 16:50:49 +0100
commit6da63e11a2c8c9cc7d9e6fff0293d5e973071af0 (patch)
treee7bc1a48e214536bcdc7d860f084d30afabeb179 /lib/events
parentcf661d5e85441f849c0e0faca1c929810d4fd752 (diff)
parentb850edadde2299b122a5cd17da85e943430e43b7 (diff)
downloadlibquotient-6da63e11a2c8c9cc7d9e6fff0293d5e973071af0.tar.gz
libquotient-6da63e11a2c8c9cc7d9e6fff0293d5e973071af0.zip
Merge pull request #448 from rpallai/richreplyfix
Fix rich replies json format (transmit)
Diffstat (limited to 'lib/events')
-rw-r--r--lib/events/roommessageevent.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/events/roommessageevent.cpp b/lib/events/roommessageevent.cpp
index 14824277..3fccb380 100644
--- a/lib/events/roommessageevent.cpp
+++ b/lib/events/roommessageevent.cpp
@@ -325,7 +325,10 @@ void TextContent::fillJson(QJsonObject* json) const
}
if (relatesTo) {
json->insert(QStringLiteral("m.relates_to"),
- QJsonObject { { "rel_type", relatesTo->type }, { EventIdKey, relatesTo->eventId } });
+ relatesTo->type == RelatesTo::ReplyTypeId() ?
+ QJsonObject { { relatesTo->type, QJsonObject{ { EventIdKey, relatesTo->eventId } } } } :
+ QJsonObject { { "rel_type", relatesTo->type }, { EventIdKey, relatesTo->eventId } }
+ );
if (relatesTo->type == RelatesTo::ReplacementTypeId()) {
QJsonObject newContentJson;
if (mimeType.inherits("text/html")) {