Use the forget function to leave a room everywhere

Use the forget function to leave a room everywhere this is both for consistency and to reduce dependencies. This way no dependency on RoomManager is required to leave a room and since in all cases they have an object they can just call the function.
This commit is contained in:
James Graham
2025-05-20 17:35:34 +01:00
parent f0d2c19393
commit a1ca768711
13 changed files with 59 additions and 42 deletions

View File

@@ -150,6 +150,14 @@ public:
*/
Q_INVOKABLE void createSpace(const QString &name, const QString &topic, const QString &parent = {}, bool setChildParent = false);
/**
* @brief Send /forget to the server and delete room locally.
*
* @note This wraps around the Quotient::Connection::forgetRoom() to allow
* roomAboutToBeLeft() to be emitted.
*/
Quotient::ForgetRoomJob *forgetRoom(const QString &id);
/**
* @brief Whether a direct chat with the user exists.
*/
@@ -224,6 +232,11 @@ Q_SIGNALS:
*/
void errorOccured(const QString &error);
/**
* @brief The given room ID is about to be forgotten.
*/
void roomAboutToBeLeft(const QString &id);
private:
static bool m_globalUrlPreviewDefault;
static PushRuleAction::Action m_defaultAction;