diff options
Diffstat (limited to 'lib/csapi/list_public_rooms.h')
-rw-r--r-- | lib/csapi/list_public_rooms.h | 80 |
1 files changed, 23 insertions, 57 deletions
diff --git a/lib/csapi/list_public_rooms.h b/lib/csapi/list_public_rooms.h index b2697c8c..8401c134 100644 --- a/lib/csapi/list_public_rooms.h +++ b/lib/csapi/list_public_rooms.h @@ -6,7 +6,6 @@ #include "jobs/basejob.h" -#include <QtCore/QVector> #include "csapi/definitions/public_rooms_response.h" #include "converters.h" @@ -15,13 +14,13 @@ namespace QMatrixClient // Operations /// Gets the visibility of a room in the directory - /// + /// /// Gets the visibility of a given room on the server's public room directory. class GetRoomVisibilityOnDirectoryJob : public BaseJob { public: /*! Gets the visibility of a room in the directory - * \param roomId + * \param roomId * The room ID. */ explicit GetRoomVisibilityOnDirectoryJob(const QString& roomId); @@ -50,7 +49,7 @@ namespace QMatrixClient }; /// Sets the visibility of a room in the room directory - /// + /// /// Sets the visibility of a given room in the server's public room /// directory. /// @@ -61,9 +60,9 @@ namespace QMatrixClient { public: /*! Sets the visibility of a room in the room directory - * \param roomId + * \param roomId * The room ID. - * \param visibility + * \param visibility * The new visibility setting for the room. * Defaults to 'public'. */ @@ -71,7 +70,7 @@ namespace QMatrixClient }; /// Lists the public rooms on the server. - /// + /// /// Lists the public rooms on the server. /// /// This API returns paginated responses. The rooms are ordered by the number @@ -80,14 +79,14 @@ namespace QMatrixClient { public: /*! Lists the public rooms on the server. - * \param limit + * \param limit * Limit the number of results returned. - * \param since + * \param since * A pagination token from a previous request, allowing clients to * get the next (or previous) batch of rooms. * The direction of pagination is specified solely by which token * is supplied, rather than via an explicit flag. - * \param server + * \param server * The server to fetch the public room lists from. Defaults to the * local server. */ @@ -117,7 +116,7 @@ namespace QMatrixClient }; /// Lists the public rooms on the server with optional filter. - /// + /// /// Lists the public rooms on the server, with optional filter. /// /// This API returns paginated responses. The rooms are ordered by the number @@ -135,68 +134,35 @@ namespace QMatrixClient QString genericSearchTerm; }; - /// Lists the public rooms on the server, with optional filter. - /// - /// This API returns paginated responses. The rooms are ordered by the number - /// of joined members, with the largest rooms first. - struct PublicRoomsChunk - { - /// Aliases of the room. May be empty. - QStringList aliases; - /// The canonical alias of the room, if any. - QString canonicalAlias; - /// The name of the room, if any. - QString name; - /// The number of members joined to the room. - qint64 numJoinedMembers; - /// The ID of the room. - QString roomId; - /// The topic of the room, if any. - QString topic; - /// Whether the room may be viewed by guest users without joining. - bool worldReadable; - /// Whether guest users may join the room and participate in it. - /// If they can, they will be subject to ordinary power level - /// rules like any other user. - bool guestCanJoin; - /// The URL for the room's avatar, if one is set. - QString avatarUrl; - }; - // Construction/destruction /*! Lists the public rooms on the server with optional filter. - * \param server + * \param server * The server to fetch the public room lists from. Defaults to the * local server. - * \param limit + * \param limit * Limit the number of results returned. - * \param since + * \param since * A pagination token from a previous request, allowing clients * to get the next (or previous) batch of rooms. The direction * of pagination is specified solely by which token is supplied, * rather than via an explicit flag. - * \param filter + * \param filter * Filter to apply to the results. + * \param includeAllNetworks + * Whether or not to include all known networks/protocols from + * application services on the homeserver. Defaults to false. + * \param thirdPartyInstanceId + * The specific third party network/protocol to request from the + * homeserver. Can only be used if ``include_all_networks`` is false. */ - explicit QueryPublicRoomsJob(const QString& server = {}, Omittable<int> limit = none, const QString& since = {}, const Omittable<Filter>& filter = none); + explicit QueryPublicRoomsJob(const QString& server = {}, Omittable<int> limit = none, const QString& since = {}, const Omittable<Filter>& filter = none, bool includeAllNetworks = false, const QString& thirdPartyInstanceId = {}); ~QueryPublicRoomsJob() override; // Result properties - /// A paginated chunk of public rooms. - const QVector<PublicRoomsChunk>& chunk() const; - /// A pagination token for the response. The absence of this token - /// means there are no more results to fetch and the client should - /// stop paginating. - const QString& nextBatch() const; - /// A pagination token that allows fetching previous results. The - /// absence of this token means there are no results before this - /// batch, i.e. this is the first batch. - const QString& prevBatch() const; - /// An estimate on the total number of public rooms, if the - /// server has an estimate. - Omittable<qint64> totalRoomCountEstimate() const; + /// A list of the rooms on the server. + const PublicRoomsResponse& data() const; protected: Status parseJson(const QJsonDocument& data) override; |