diff options
Diffstat (limited to 'lib/connection.cpp')
-rw-r--r-- | lib/connection.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp index c4587f30..1ac439a3 100644 --- a/lib/connection.cpp +++ b/lib/connection.cpp @@ -811,7 +811,7 @@ JoinRoomJob* Connection::joinRoom(const QString& roomAlias, // that may add their own slots to finished(). connect(job, &BaseJob::finished, this, [this, job] { if (job->status().good()) - provideRoom(job->roomId()); + provideRoom(job->roomId(), JoinState::Join); }); return job; } @@ -1474,11 +1474,13 @@ Room* Connection::provideRoom(const QString& id, Omittable<JoinState> joinState) room = d->roomMap.value({ id, true }, nullptr); if (room) return room; - // No Invite either, setup a new room object below + // No Invite either, setup a new room object in Join state + joinState = JoinState::Join; } if (!room) { - room = roomFactory()(this, id, joinState.value_or(JoinState::Join)); + Q_ASSERT(joinState.has_value()); + room = roomFactory()(this, id, *joinState); if (!room) { qCCritical(MAIN) << "Failed to create a room" << id; return nullptr; |