aboutsummaryrefslogtreecommitdiff
path: root/connection.h
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2017-10-14 05:23:22 +0200
committerKitsune Ral <Kitsune-Ral@users.sf.net>2017-10-14 09:17:35 +0200
commit608e7a7163583e2e30cd6c3e9de7449c41651ca4 (patch)
tree9b2f3b07ff6984bc60cc539ab37221f938b05227 /connection.h
parent8058139171897eea4a35325b98ba2f72a8c7303f (diff)
downloadlibquotient-608e7a7163583e2e30cd6c3e9de7449c41651ca4.tar.gz
libquotient-608e7a7163583e2e30cd6c3e9de7449c41651ca4.zip
Connection::forgetRoom()
Diffstat (limited to 'connection.h')
-rw-r--r--connection.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/connection.h b/connection.h
index dbb50b9a..4afae08f 100644
--- a/connection.h
+++ b/connection.h
@@ -18,6 +18,7 @@
#pragma once
+#include "jobs/generated/leaving.h"
#include "joinstate.h"
#include <QtCore/QObject>
@@ -94,6 +95,19 @@ namespace QMatrixClient
/** @deprecated Use callApi<MediaThumbnailJob>() instead */
MediaThumbnailJob* getThumbnail(const QUrl& url, int requestedWidth,
int requestedHeight) const;
+ /** Sends /forget to the server and also deletes room locally.
+ * This method is in Connection, not in Room, since it's a
+ * room lifecycle operation, and Connection is an acting room manager.
+ * It ensures that the local user is not a member of a room (running /leave,
+ * if necessary) then issues a /forget request and if that one doesn't fail
+ * deletion of the local Room object is ensured.
+ * \param id - the room id to forget
+ * \return - the ongoing /forget request to the server; note that the
+ * success() signal of this request is connected to deleteLater()
+ * of a respective room so by the moment this finishes, there might be no
+ * Room object anymore.
+ */
+ ForgetRoomJob* forgetRoom(const QString& id) const;
Q_INVOKABLE QUrl homeserver() const;
Q_INVOKABLE User* user(const QString& userId);