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:
James Graham
2024-01-31 20:33:36 +00:00
parent 79cf399bf5
commit 4746401bec
6 changed files with 45 additions and 8 deletions

View File

@@ -44,15 +44,24 @@ public:
return &instance();
}
/**
* @brief Whether the given room is a member of the given space.
*/
Q_INVOKABLE bool isSpaceChild(const QString &spaceId, const QString &roomId);
/**
* @brief Return the list of child rooms for the given space ID.
*/
[[nodiscard]] QList<QString> &getRoomListForSpace(const QString &spaceId, bool updateCache);
/**
* @brief Returns whether the space is a child space of any other space.
* @brief Returns whether the room is a child space of any space.
*
* @note We need to do this from the hierarchy as it is not guaranteed that the
* child knows it's in a space. See
* https://spec.matrix.org/v1.8/client-server-api/#managing-roomsspaces-included-in-a-space
*/
[[nodiscard]] bool isChildSpace(const QString &spaceId) const;
[[nodiscard]] bool isChild(const QString &roomId) const;
NeoChatConnection *connection() const;
void setConnection(NeoChatConnection *connection);