From 2379e3d83b130ddac3082c4cb4ced28485bdb28d Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Fri, 15 Nov 2024 22:37:56 -0500 Subject: [PATCH] Don't scroll up when clicking on the same room over and over If you try to click on your current room in the list, it scrolls up the messages a bit. This is because in RoomManager::visitRoom it's being called with an empty eventId and we will happily emit a goToEvent. This is despite there being nothing to go to. Fixes #677. --- src/roommanager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/roommanager.cpp b/src/roommanager.cpp index b94142a8f..01c18a765 100644 --- a/src/roommanager.cpp +++ b/src/roommanager.cpp @@ -315,7 +315,9 @@ void RoomManager::visitRoom(Room *r, const QString &eventId) // It's important that we compare room *objects* here, not just room *ids*, since we need to deal with the object changing when going invite -> joined if (m_currentRoom && m_currentRoom == room) { - Q_EMIT goToEvent(eventId); + if (!eventId.isEmpty()) { + Q_EMIT goToEvent(eventId); + } } else { setCurrentRoom(room->id()); }