Don't suggest joining the last opened room when neochat is started after the cache was cleared

This commit is contained in:
Tobias Fella
2024-05-24 14:17:37 +02:00
parent a545eaca97
commit 9d650519c7

View File

@@ -239,10 +239,11 @@ void RoomManager::openRoomForActiveConnection()
if (!m_connection) { if (!m_connection) {
m_currentRoom = nullptr; m_currentRoom = nullptr;
} }
if (m_lastRoomConfig.readEntry(m_connection->userId(), QString()).isEmpty()) { const auto &lastRoom = m_lastRoomConfig.readEntry(m_connection->userId(), QString());
if (lastRoom.isEmpty() || !m_connection->room(lastRoom)) {
setCurrentRoom({}); setCurrentRoom({});
} else { } else {
resolveResource(m_lastRoomConfig.readEntry(m_connection->userId(), QString())); resolveResource(lastRoom);
} }
setCurrentSpace(m_lastSpaceConfig.readEntry(m_connection->userId(), QString()), false); setCurrentSpace(m_lastSpaceConfig.readEntry(m_connection->userId(), QString()), false);
} }