Remove room from RoomTreeModel before leaving it

This makes sure that the room disappears from the tree view
This commit is contained in:
Tobias Fella
2024-02-20 20:42:02 +01:00
parent e3ed2fcaa9
commit 1296255a86

View File

@@ -46,6 +46,7 @@ void RoomTreeModel::setConnection(NeoChatConnection *connection)
endResetModel();
connect(connection, &Connection::newRoom, this, &RoomTreeModel::newRoom);
connect(connection, &Connection::leftRoom, this, &RoomTreeModel::leftRoom);
connect(connection, &Connection::aboutToDeleteRoom, this, &RoomTreeModel::leftRoom);
for (const auto &room : m_connection->allRooms()) {
newRoom(dynamic_cast<NeoChatRoom *>(room));