diff options
author | Roland Pallai <dap78@magex.hu> | 2020-03-17 19:57:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-17 19:57:11 +0100 |
commit | 5b7bfc2d559c1707208007f2b7d5c8e898b98f7e (patch) | |
tree | 75b817a0aaea372d6711c25a69a2023403fcb709 /lib/room.cpp | |
parent | 301d29e8db272938b0977af5db872c80f89fd708 (diff) | |
download | libquotient-5b7bfc2d559c1707208007f2b7d5c8e898b98f7e.tar.gz libquotient-5b7bfc2d559c1707208007f2b7d5c8e898b98f7e.zip |
MSC1849 compatible edited messages (#373)
* Make handling of edited messages MSC1849 compatible
Server side aggregation replaces `content` with `new_content` in
edited messages. The same must be done at client side on
incremental updates to keep timeline consistent.
As server side aggregations is in use by default from Synapse 1.2.0
this patch fixes a real issue.
Diffstat (limited to 'lib/room.cpp')
-rw-r--r-- | lib/room.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/room.cpp b/lib/room.cpp index 5a966ceb..2945111a 100644 --- a/lib/room.cpp +++ b/lib/room.cpp @@ -2127,7 +2127,7 @@ RoomEventPtr makeReplaced(const RoomEvent& target, const RoomMessageEvent& replacement) { auto originalJson = target.originalJsonObject(); - originalJson[ContentKeyL] = replacement.contentJson(); + originalJson[ContentKeyL] = replacement.contentJson().value("m.new_content"_ls); auto unsignedData = originalJson.take(UnsignedKeyL).toObject(); auto relations = unsignedData.take("m.relations"_ls).toObject(); |