From aaaaf912488bafed6958e8e11b154a7c6308b8d8 Mon Sep 17 00:00:00 2001 From: Tobias Fella Date: Fri, 20 Feb 2026 15:17:23 +0100 Subject: [PATCH] Don't try opening last room when this room is not available When switching connection to a connection that is not loaded or where we have left the last room, trying to resolve it will not do anything, causing the room from the previous connection to stay open --- src/app/roommanager.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/roommanager.cpp b/src/app/roommanager.cpp index 7baa01dce..5ad0df93f 100644 --- a/src/app/roommanager.cpp +++ b/src/app/roommanager.cpp @@ -537,13 +537,14 @@ void RoomManager::setCurrentSpace(const QString &spaceId, bool goToLastUsedRoom) LastRoomBlocker blocker(this); // We can't have empty keys in KConfig, so it's stored as "Home": - if (const auto &lastRoom = m_lastRoomConfig.readEntry(spaceId.isEmpty() ? u"Home"_s : spaceId, QString()); !lastRoom.isEmpty()) { + if (const auto &lastRoom = m_lastRoomConfig.readEntry(spaceId.isEmpty() ? u"Home"_s : spaceId, QString()); + !lastRoom.isEmpty() && m_connection->room(lastRoom)) { resolveResource(lastRoom, "no_join"_L1); return; } // If no last room was opened, go to the space home: - if (!spaceId.isEmpty() && spaceId != u"DM"_s) { + if (!spaceId.isEmpty() && spaceId != u"DM"_s && m_connection->room(spaceId)) { resolveResource(spaceId, "no_join"_L1); return; }