aboutsummaryrefslogtreecommitdiff
path: root/lib/room.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/room.cpp')
-rw-r--r--lib/room.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/room.cpp b/lib/room.cpp
index a0cac18a..ea771f17 100644
--- a/lib/room.cpp
+++ b/lib/room.cpp
@@ -420,7 +420,7 @@ void Room::Private::updateUnreadCount(rev_iter_t from, rev_iter_t to)
unreadMessages = 0;
unreadMessages += newUnreadMessages;
- qCDebug(MAIN) << "Room" << displayname << "has gained"
+ qCDebug(MAIN) << "Room" << q->objectName() << "has gained"
<< newUnreadMessages << "unread message(s),"
<< (q->readMarker() == timeline.crend() ?
"in total at least" : "in total")
@@ -1701,7 +1701,7 @@ void Room::Private::addNewMessageEvents(RoomEvents&& events)
if (totalInserted > 0)
{
qCDebug(MAIN)
- << "Room" << displayname << "received" << totalInserted
+ << "Room" << q->objectName() << "received" << totalInserted
<< "new events; the last event is now" << timeline.back();
// The first event in the just-added batch (referred to by `from`)
@@ -1726,6 +1726,7 @@ void Room::Private::addNewMessageEvents(RoomEvents&& events)
void Room::Private::addHistoricalMessageEvents(RoomEvents&& events)
{
+ QElapsedTimer et; et.start();
const auto timelineSize = timeline.size();
dropDuplicateEvents(events);
@@ -1748,6 +1749,9 @@ void Room::Private::addHistoricalMessageEvents(RoomEvents&& events)
updateUnreadCount(from, timeline.crend());
Q_ASSERT(timeline.size() == timelineSize + insertedSize);
+ if (insertedSize > 9 || et.nsecsElapsed() >= profilerMinNsecs())
+ qCDebug(PROFILER) << "*** Room::addHistoricalMessageEvents():"
+ << insertedSize << "event(s)," << et;
}
bool Room::processStateEvent(const RoomEvent& e)
@@ -1791,8 +1795,7 @@ bool Room::processStateEvent(const RoomEvent& e)
u->processEvent(evt, this);
if (u == localUser() && memberJoinState(u) == JoinState::Invite
&& evt.isDirect())
- connection()->addToDirectChats(this,
- user(evt.senderId()));
+ connection()->addToDirectChats(this, user(evt.senderId()));
if( evt.membership() == MembershipType::Join )
{