aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-08-03 20:55:13 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-08-03 20:55:13 +0900
commit7298e99125522c4d010ec83052cd10ce085e09b4 (patch)
tree2c0a2a41c1f9d165844eb6890d7abc03e2bbae6d /lib
parented28e010c6423ccec730ca581b8d6d48c2c6cd17 (diff)
downloadlibquotient-7298e99125522c4d010ec83052cd10ce085e09b4.tar.gz
libquotient-7298e99125522c4d010ec83052cd10ce085e09b4.zip
Room: improve logging, add an assertion
Diffstat (limited to 'lib')
-rw-r--r--lib/room.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/room.cpp b/lib/room.cpp
index c6611bd5..a3f7bda2 100644
--- a/lib/room.cpp
+++ b/lib/room.cpp
@@ -399,7 +399,6 @@ void Room::Private::updateUnreadCount(rev_iter_t from, rev_iter_t to)
const auto readMarker = q->readMarker();
if (readMarker >= from && readMarker < to)
{
- qCDebug(MAIN) << "Discovered last read event in room" << displayname;
promoteReadMarker(q->localUser(), readMarker, true);
return;
}
@@ -545,7 +544,11 @@ Room::rev_iter_t Room::findInTimeline(TimelineItem::index_t index) const
Room::rev_iter_t Room::findInTimeline(const QString& evtId) const
{
if (!d->timeline.empty() && d->eventsIndex.contains(evtId))
- return findInTimeline(d->eventsIndex.value(evtId));
+ {
+ auto it = findInTimeline(d->eventsIndex.value(evtId));
+ Q_ASSERT((*it)->id() == evtId);
+ return it;
+ }
return timelineEdge();
}
@@ -1581,6 +1584,9 @@ void Room::Private::addNewMessageEvents(RoomEvents&& events)
it = nextPending + 1;
emit q->pendingEventAboutToMerge(nextPending->get(),
nextPendingPair.second - unsyncedEvents.begin());
+ qDebug(EVENTS) << "Merging pending event from transaction"
+ << (*nextPending)->transactionId() << "into"
+ << (*nextPending)->id();
unsyncedEvents.erase(nextPendingPair.second);
if (auto insertedSize = moveEventsToTimeline({nextPending, it}, Newer))
{