diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-09-02 16:08:13 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-09-29 22:00:06 +0900 |
commit | 1e6510790dab6b9141ae52993987b406399668cd (patch) | |
tree | 1a45c0ccfec8f5f7ba37eb4385cdc7f61afa0c97 /lib/csapi/list_public_rooms.h | |
parent | 4244cee8d5e0f760cccd2b45ad587670573ef03c (diff) | |
download | libquotient-1e6510790dab6b9141ae52993987b406399668cd.tar.gz libquotient-1e6510790dab6b9141ae52993987b406399668cd.zip |
Support CS API 0.4.0
Numerous changes in CS (and now also AS) API, including compatibility-breaking ones - see the diff for details.
Diffstat (limited to 'lib/csapi/list_public_rooms.h')
-rw-r--r-- | lib/csapi/list_public_rooms.h | 52 |
1 files changed, 9 insertions, 43 deletions
diff --git a/lib/csapi/list_public_rooms.h b/lib/csapi/list_public_rooms.h index 4c5e872d..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" @@ -135,34 +134,6 @@ 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. @@ -178,25 +149,20 @@ namespace QMatrixClient * rather than via an explicit flag. * \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; |