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, 6 insertions, 5 deletions
diff --git a/lib/room.cpp b/lib/room.cpp
index 4d9f952c..4ba699b0 100644
--- a/lib/room.cpp
+++ b/lib/room.cpp
@@ -415,11 +415,6 @@ Room::Room(Connection* connection, QString id, JoinState initialJoinState)
// https://marcmutz.wordpress.com/translated-articles/pimp-my-pimpl-%E2%80%94-reloaded/
d->q = this;
d->displayname = d->calculateDisplayname(); // Set initial "Empty room" name
- connectUntil(connection, &Connection::loadedRoomState, this, [this](Room* r) {
- if (this == r)
- emit baseStateLoaded();
- return this == r; // loadedRoomState fires only once per room
- });
#ifdef Quotient_E2EE_ENABLED
connectSingleShot(this, &Room::encryption, this, [this, connection](){
connection->encryptionUpdate(this);
@@ -1820,6 +1815,9 @@ Room::Changes Room::Private::updateStatsFromSyncData(const SyncRoomData& data,
void Room::updateData(SyncRoomData&& data, bool fromCache)
{
+ qCDebug(MAIN) << "--- Updating room" << id() << "/" << objectName();
+ bool firstUpdate = d->baseState.empty();
+
if (d->prevBatch.isEmpty())
d->prevBatch = data.timelinePrevBatch;
setJoinState(data.joinState);
@@ -1845,6 +1843,9 @@ void Room::updateData(SyncRoomData&& data, bool fromCache)
emit namesChanged(this);
d->postprocessChanges(roomChanges, !fromCache);
+ if (firstUpdate)
+ emit baseStateLoaded();
+ qCDebug(MAIN) << "--- Finished updating room" << id() << "/" << objectName();
}
void Room::Private::postprocessChanges(Changes changes, bool saveState)