From 0a4e95a1db11c45e3880eee4982753a9faf0a3da Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Tue, 13 Jul 2021 02:57:16 +0200 Subject: Don't allow switching to current room fixes #634 --- src/timeline/RoomlistModel.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/timeline') diff --git a/src/timeline/RoomlistModel.cpp b/src/timeline/RoomlistModel.cpp index 1c1057e1..cb800699 100644 --- a/src/timeline/RoomlistModel.cpp +++ b/src/timeline/RoomlistModel.cpp @@ -602,6 +602,10 @@ RoomlistModel::leave(QString roomid) void RoomlistModel::setCurrentRoom(QString roomid) { + if ((currentRoom_ && currentRoom_->roomId() == roomid) || + (currentRoomPreview_ && currentRoomPreview_->roomid() == roomid)) + return; + nhlog::ui()->debug("Trying to switch to: {}", roomid.toStdString()); if (models.contains(roomid)) { currentRoom_ = models.value(roomid); -- cgit 1.4.1