diff options
Diffstat (limited to 'lib/room.cpp')
-rw-r--r-- | lib/room.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/room.cpp b/lib/room.cpp index ea8df286..ceb8d111 100644 --- a/lib/room.cpp +++ b/lib/room.cpp @@ -54,7 +54,6 @@ #include <QtCore/QDir> #include <QtCore/QHash> -#include <QtCore/QMimeDatabase> #include <QtCore/QPointer> #include <QtCore/QRegularExpression> #include <QtCore/QStringBuilder> // for efficient string concats (operator%) @@ -2309,8 +2308,13 @@ bool Room::Private::processRedaction(const RedactionEvent& redaction) RoomEventPtr makeReplaced(const RoomEvent& target, const RoomMessageEvent& replacement) { + const auto &targetReply = target.contentJson()["m.relates_to"].toObject(); + auto newContent = replacement.contentJson().value("m.new_content"_ls).toObject(); + if (!targetReply.empty()) { + newContent["m.relates_to"] = targetReply; + } auto originalJson = target.originalJsonObject(); - originalJson[ContentKeyL] = replacement.contentJson().value("m.new_content"_ls); + originalJson[ContentKeyL] = newContent; auto unsignedData = originalJson.take(UnsignedKeyL).toObject(); auto relations = unsignedData.take("m.relations"_ls).toObject(); @@ -2853,7 +2857,8 @@ Room::Changes Room::processAccountDataEvent(EventPtr&& event) qCDebug(STATE) << "Updated account data of type" << currentData->matrixType(); emit accountDataChanged(currentData->matrixType()); - changes |= Change::AccountDataChange; + // TODO: Drop AccountDataChange in 0.8 + QT_IGNORE_DEPRECATIONS(changes |= AccountDataChange|OtherChange); } return changes; } |