From df6b2d31ec8f2f5890826719e960f450a4968f22 Mon Sep 17 00:00:00 2001
From: Roland Pallai <dap78@magex.hu>
Date: Thu, 28 Jan 2021 15:05:33 +0100
Subject: Fix rich edits (transmit)

The new formatted_body was not included into new content on edit
due to badly constructed json.
---
 lib/events/roommessageevent.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'lib/events')

diff --git a/lib/events/roommessageevent.cpp b/lib/events/roommessageevent.cpp
index 14824277..4a733772 100644
--- a/lib/events/roommessageevent.cpp
+++ b/lib/events/roommessageevent.cpp
@@ -329,8 +329,8 @@ void TextContent::fillJson(QJsonObject* json) const
         if (relatesTo->type == RelatesTo::ReplacementTypeId()) {
             QJsonObject newContentJson;
             if (mimeType.inherits("text/html")) {
-                json->insert(FormatKey, HtmlContentTypeId);
-                json->insert(FormattedBodyKey, body);
+                newContentJson.insert(FormatKey, HtmlContentTypeId);
+                newContentJson.insert(FormattedBodyKey, body);
             }
             json->insert(QStringLiteral("m.new_content"), newContentJson);
         }
-- 
cgit v1.2.3