aboutsummaryrefslogtreecommitdiff
path: root/lib/connection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/connection.cpp')
-rw-r--r--lib/connection.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp
index 572ac76b..dae7b663 100644
--- a/lib/connection.cpp
+++ b/lib/connection.cpp
@@ -82,6 +82,7 @@ class Connection::Private
// Leave state of the same room.
QHash<QPair<QString, bool>, Room*> roomMap;
QVector<QString> roomIdsToForget;
+ QVector<Room*> firstTimeRooms;
QMap<QString, User*> userMap;
DirectChatsMap directChats;
QHash<QString, AccountDataMap> accountData;
@@ -308,7 +309,11 @@ void Connection::onSyncSuccess(SyncData &&data) {
<< "state - suspiciously fast turnaround";
}
if ( auto* r = provideRoom(roomData.roomId, roomData.joinState) )
+ {
r->updateData(std::move(roomData));
+ if (d->firstTimeRooms.removeOne(r))
+ emit loadedRoomState(r);
+ }
QCoreApplication::processEvents();
}
for (auto&& accountEvent: data.takeAccountData())
@@ -804,6 +809,7 @@ Room* Connection::provideRoom(const QString& id, JoinState joinState)
return nullptr;
}
d->roomMap.insert(roomKey, room);
+ d->firstTimeRooms.push_back(room);
emit newRoom(room);
}
if (joinState == JoinState::Invite)