summary refs log tree commit diff
path: root/src/timeline
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-07-13 02:57:16 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2021-07-13 02:57:16 +0200
commit0a4e95a1db11c45e3880eee4982753a9faf0a3da (patch)
tree11fa6b355133bd7df2d259d32e0f447126bb722c /src/timeline
parentTry to fix crash in setCurrentIndex (diff)
downloadnheko-0a4e95a1db11c45e3880eee4982753a9faf0a3da.tar.xz
Don't allow switching to current room
fixes #634
Diffstat (limited to 'src/timeline')
-rw-r--r--src/timeline/RoomlistModel.cpp4
1 files changed, 4 insertions, 0 deletions
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);