summary refs log tree commit diff
path: root/src/Cache_p.h
diff options
context:
space:
mode:
authorAlexander Bantyev <balsoft@balsoft.ru>2021-06-17 22:27:37 +0300
committerAlexander Bantyev <balsoft@balsoft.ru>2021-06-18 16:38:55 +0300
commit9f798e76ede3672d91276b1be7dd20de5459c9df (patch)
treea17b1c2fbdc6248d9ce09682bfb5bafc898d0286 /src/Cache_p.h
parentTranslated using Weblate (Esperanto) (diff)
downloadnheko-9f798e76ede3672d91276b1be7dd20de5459c9df.tar.xz
Allow editing unsent messages
As of 0db4d71ec2483c7ac5a7b536737fee8fc53a76d7 (Prevent edits of
unsent messages), messages that are edits of (or replies to) unsent
messages were not allowed. This change was made because otherwise
the edits were discarded due to use of txnid rather than mxid in the
"m.relates_to" object. Remove this restriction and fix the issue by
replacing txnid with mxid in all related events when the message is
sent (and we obtain mxid from the server).
Diffstat (limited to 'src/Cache_p.h')
-rw-r--r--src/Cache_p.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Cache_p.h b/src/Cache_p.h
index f2911622..669f1895 100644
--- a/src/Cache_p.h
+++ b/src/Cache_p.h
@@ -184,6 +184,9 @@ public:
         void storeEvent(const std::string &room_id,
                         const std::string &event_id,
                         const mtx::events::collections::TimelineEvent &event);
+        void replaceEvent(const std::string &room_id,
+                          const std::string &event_id,
+                          const mtx::events::collections::TimelineEvent &event);
         std::vector<std::string> relatedEvents(const std::string &room_id,
                                                const std::string &event_id);