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.
(cherry picked from commit 2379e3d83b)
This commit is contained in:
@@ -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
|
// 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) {
|
if (m_currentRoom && m_currentRoom == room) {
|
||||||
Q_EMIT goToEvent(eventId);
|
if (!eventId.isEmpty()) {
|
||||||
|
Q_EMIT goToEvent(eventId);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
setCurrentRoom(room->id());
|
setCurrentRoom(room->id());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user