mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-29 14:18:49 +03:00
fixup! Allow editing unsent messages
This commit is contained in:
parent
42bf8799ee
commit
358a39e6d2
2 changed files with 7 additions and 1 deletions
|
@ -186,7 +186,11 @@ EventStore::EventStore(std::string room_id, QObject *)
|
||||||
nhlog::ui()->debug("sent {}", txn_id);
|
nhlog::ui()->debug("sent {}", txn_id);
|
||||||
|
|
||||||
// Replace the event_id in pending edits/replies/redactions with the actual
|
// Replace the event_id in pending edits/replies/redactions with the actual
|
||||||
// event_id of this event
|
// event_id of this event. This allows one to edit and reply to events that are
|
||||||
|
// currently pending.
|
||||||
|
|
||||||
|
// FIXME (introduced by balsoft): this doesn't work for encrypted events, but
|
||||||
|
// allegedly it's hard to fix so I'll leave my first contribution at that
|
||||||
for (auto related_event_id : cache::client()->relatedEvents(room_id_, txn_id)) {
|
for (auto related_event_id : cache::client()->relatedEvents(room_id_, txn_id)) {
|
||||||
if (cache::client()->getEvent(room_id_, related_event_id)) {
|
if (cache::client()->getEvent(room_id_, related_event_id)) {
|
||||||
auto related_event =
|
auto related_event =
|
||||||
|
|
|
@ -375,6 +375,8 @@ TimelineModel::TimelineModel(TimelineViewManager *manager, QString room_id, QObj
|
||||||
connect(&events, &EventStore::updateFlowEventId, this, [this](std::string event_id) {
|
connect(&events, &EventStore::updateFlowEventId, this, [this](std::string event_id) {
|
||||||
this->updateFlowEventId(event_id);
|
this->updateFlowEventId(event_id);
|
||||||
});
|
});
|
||||||
|
// When a message is sent, check if the current edit/reply relates to that message,
|
||||||
|
// and update the event_id so that it points to the sent message and not the pending one.
|
||||||
connect(&events,
|
connect(&events,
|
||||||
&EventStore::messageSent,
|
&EventStore::messageSent,
|
||||||
this,
|
this,
|
||||||
|
|
Loading…
Reference in a new issue