Change the behaviour when clicking on a space
- When click on a space the space home page is shown, unless the current room is also a member of the new space - When changing to friends or global the first is entered - The global now only contains rooms that are not part of a space - Global is now home
This commit is contained in:
@@ -74,6 +74,11 @@ void SpaceHierarchyCache::removeSpaceFromHierarchy(Quotient::Room *room)
|
||||
}
|
||||
}
|
||||
|
||||
bool SpaceHierarchyCache::isSpaceChild(const QString &spaceId, const QString &roomId)
|
||||
{
|
||||
return getRoomListForSpace(spaceId, false).contains(roomId);
|
||||
}
|
||||
|
||||
QList<QString> &SpaceHierarchyCache::getRoomListForSpace(const QString &spaceId, bool updateCache)
|
||||
{
|
||||
if (updateCache) {
|
||||
@@ -82,11 +87,11 @@ QList<QString> &SpaceHierarchyCache::getRoomListForSpace(const QString &spaceId,
|
||||
return m_spaceHierarchy[spaceId];
|
||||
}
|
||||
|
||||
bool SpaceHierarchyCache::isChildSpace(const QString &spaceId) const
|
||||
bool SpaceHierarchyCache::isChild(const QString &roomId) const
|
||||
{
|
||||
const auto childrens = m_spaceHierarchy.values();
|
||||
for (const auto &children : childrens) {
|
||||
if (children.contains(spaceId)) {
|
||||
if (children.contains(roomId)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user