From 9f798e76ede3672d91276b1be7dd20de5459c9df Mon Sep 17 00:00:00 2001 From: Alexander Bantyev Date: Thu, 17 Jun 2021 22:27:37 +0300 Subject: 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). --- src/Cache_p.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/Cache_p.h') 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 relatedEvents(const std::string &room_id, const std::string &event_id); -- cgit 1.5.1