Skip to content

Commit

Permalink
Only signal pending event as merged once the real one is in the timeline
Browse files Browse the repository at this point in the history
Previously the future returned by PendingEventItem::whenMerged() was
finished a bit too soon, just before the actual event showed up in the
timeline.
  • Loading branch information
KitsuneRal committed Dec 9, 2024
1 parent 4c97d1d commit 862c3ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Quotient/room.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2793,9 +2793,9 @@ Room::Timeline::size_type Room::Private::mergePendingEvent(PendingEvents::iterat
// unsyncedEvents (see #286). Fortunately, unsyncedEvents only grows at
// its back so we can rely on the index staying valid at least.
localEchoIt = unsyncedEvents.begin() + pendingEvtIdx;
const auto insertedSize = moveEventsToTimeline({ remoteEchoIt, remoteEchoIt + 1 }, Newer);
localEchoIt->setMerged(*remoteEcho);
unsyncedEvents.erase(localEchoIt);
const auto insertedSize = moveEventsToTimeline({ remoteEchoIt, remoteEchoIt + 1 }, Newer);
if (insertedSize > 0)
q->onAddNewTimelineEvents(syncEdge() - insertedSize);

Expand Down

0 comments on commit 862c3ad

Please sign in to comment.