aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/list_joined_rooms.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/csapi/list_joined_rooms.h')
-rw-r--r--lib/csapi/list_joined_rooms.h52
1 files changed, 22 insertions, 30 deletions
diff --git a/lib/csapi/list_joined_rooms.h b/lib/csapi/list_joined_rooms.h
index 881a97b4..1034aa7b 100644
--- a/lib/csapi/list_joined_rooms.h
+++ b/lib/csapi/list_joined_rooms.h
@@ -6,39 +6,31 @@
#include "jobs/basejob.h"
+namespace Quotient {
-namespace QMatrixClient
-{
- // Operations
-
+/*! \brief Lists the user's current rooms.
+ *
+ * This API returns a list of the user's current rooms.
+ */
+class GetJoinedRoomsJob : public BaseJob {
+public:
/// Lists the user's current rooms.
- ///
- /// This API returns a list of the user's current rooms.
- class GetJoinedRoomsJob : public BaseJob
- {
- public:
- explicit GetJoinedRoomsJob();
+ explicit GetJoinedRoomsJob();
- /*! Construct a URL without creating a full-fledged job object
- *
- * This function can be used when a URL for
- * GetJoinedRoomsJob is necessary but the job
- * itself isn't.
- */
- static QUrl makeRequestUrl(QUrl baseUrl);
+ /*! \brief Construct a URL without creating a full-fledged job object
+ *
+ * This function can be used when a URL for GetJoinedRoomsJob
+ * is necessary but the job itself isn't.
+ */
+ static QUrl makeRequestUrl(QUrl baseUrl);
- ~GetJoinedRoomsJob() override;
+ // Result properties
- // Result properties
-
- /// The ID of each room in which the user has ``joined`` membership.
- const QStringList& joinedRooms() const;
-
- protected:
- Status parseJson(const QJsonDocument& data) override;
+ /// The ID of each room in which the user has ``joined`` membership.
+ QStringList joinedRooms() const
+ {
+ return loadFromJson<QStringList>("joined_rooms"_ls);
+ }
+};
- private:
- class Private;
- QScopedPointer<Private> d;
- };
-} // namespace QMatrixClient
+} // namespace Quotient