Don't show direct messages in room list when not in a space
2b0251c593 changed the logic to also show direct messages inside a space
However this also causes direct messages to be shown when *not* inside a space, which is undesirable
This commit is contained in:
@@ -519,7 +519,14 @@ void RoomManager::setCurrentSpace(const QString &spaceId, bool setRoom)
|
|||||||
|
|
||||||
// This need to happen before the signal so TreeView.expandRecursively() can work nicely.
|
// This need to happen before the signal so TreeView.expandRecursively() can work nicely.
|
||||||
m_sortFilterRoomTreeModel->setActiveSpaceId(m_currentSpaceId);
|
m_sortFilterRoomTreeModel->setActiveSpaceId(m_currentSpaceId);
|
||||||
m_sortFilterRoomTreeModel->setMode(m_currentSpaceId == u"DM"_s ? SortFilterRoomTreeModel::DirectChats : SortFilterRoomTreeModel::All);
|
|
||||||
|
if (m_currentSpaceId == u"DM") {
|
||||||
|
m_sortFilterRoomTreeModel->setMode(SortFilterRoomTreeModel::DirectChats);
|
||||||
|
} else if (m_currentSpaceId.isEmpty()) {
|
||||||
|
m_sortFilterRoomTreeModel->setMode(SortFilterRoomTreeModel::Rooms);
|
||||||
|
} else {
|
||||||
|
m_sortFilterRoomTreeModel->setMode(SortFilterRoomTreeModel::All);
|
||||||
|
}
|
||||||
|
|
||||||
Q_EMIT currentSpaceChanged();
|
Q_EMIT currentSpaceChanged();
|
||||||
if (m_connection) {
|
if (m_connection) {
|
||||||
|
|||||||
Reference in New Issue
Block a user