aboutsummaryrefslogtreecommitdiff
path: root/lib/room.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-08-06 21:17:01 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-08-06 21:17:01 +0900
commitc8dc0c075497ca8f174b738ee4253ca282cbec8c (patch)
tree5c879bba3384d21da8ba395d96f70ba4ade08dd7 /lib/room.cpp
parentc0e75a52504a3d31bcca0d4c39745d4d6c1fe917 (diff)
downloadlibquotient-c8dc0c075497ca8f174b738ee4253ca282cbec8c.tar.gz
libquotient-c8dc0c075497ca8f174b738ee4253ca282cbec8c.zip
Room: addedMessages passes timeline indices
Diffstat (limited to 'lib/room.cpp')
-rw-r--r--lib/room.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/room.cpp b/lib/room.cpp
index e8f67f3f..27f54ddb 100644
--- a/lib/room.cpp
+++ b/lib/room.cpp
@@ -1599,12 +1599,11 @@ void Room::Private::addNewMessageEvents(RoomEvents&& events)
{
RoomEventsRange eventsSpan { it, nextPending };
emit q->aboutToAddNewMessages(eventsSpan);
- if (auto insertedSize = moveEventsToTimeline(eventsSpan, Newer))
- {
- totalInserted += insertedSize;
- q->onAddNewTimelineEvents(timeline.cend() - insertedSize);
- }
- emit q->addedMessages();
+ auto insertedSize = moveEventsToTimeline(eventsSpan, Newer);
+ totalInserted += insertedSize;
+ auto firstInserted = timeline.cend() - insertedSize;
+ q->onAddNewTimelineEvents(firstInserted);
+ emit q->addedMessages(firstInserted->index(), timeline.back().index());
}
if (nextPending == newEnd)
break;
@@ -1669,7 +1668,7 @@ void Room::Private::addHistoricalMessageEvents(RoomEvents&& events)
qCDebug(MAIN) << "Room" << displayname << "received" << insertedSize
<< "past events; the oldest event is now" << timeline.front();
q->onAddHistoricalTimelineEvents(from);
- emit q->addedMessages();
+ emit q->addedMessages(timeline.front().index(), from->index());
if (from <= q->readMarker())
updateUnreadCount(from, timeline.crend());