From 12a6da012a591950278b40d614e035031adc7f08 Mon Sep 17 00:00:00 2001
From: Nicolas Werner <nicolas.werner@hotmail.de>
Date: Sat, 5 Mar 2022 19:38:13 +0100
Subject: [PATCH] If you replace the txn id, replace a string the length of the
 txn id...

---
 src/timeline/EventStore.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/timeline/EventStore.cpp b/src/timeline/EventStore.cpp
index 4151356f9..1293245c4 100644
--- a/src/timeline/EventStore.cpp
+++ b/src/timeline/EventStore.cpp
@@ -208,7 +208,7 @@ EventStore::EventStore(std::string room_id, QObject *)
                       size_t index = related_text->content.formatted_body.find(txn_id);
                       if (index != std::string::npos) {
                           related_text->content.formatted_body.replace(
-                            index, event_id.length(), event_id);
+                            index, txn_id.length(), event_id);
                       }
                   }
 
-- 
GitLab