From e17764a1ae81393968dfb747c7b67353c109bc71 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Fri, 19 Jun 2020 15:01:33 +0200 Subject: csapi/: generated using the latest GTAD and matrix-doc For matrix-doc, specifically, it is master (5cb4b086) merged with https://github.com/matrix-org/matrix-doc/pull/2518. --- lib/csapi/account-data.h | 4 -- lib/csapi/admin.h | 1 - lib/csapi/administrative_contact.h | 15 ++--- lib/csapi/appservice_room_directory.h | 1 - lib/csapi/banning.h | 2 - lib/csapi/content-repo.h | 37 +++++------- lib/csapi/create_room.h | 1 - lib/csapi/definitions/request_email_validation.h | 2 +- lib/csapi/definitions/request_msisdn_validation.h | 2 +- lib/csapi/device_management.h | 6 +- lib/csapi/directory.h | 4 -- lib/csapi/event_context.h | 1 - lib/csapi/filter.h | 6 +- lib/csapi/inviting.h | 1 - lib/csapi/joining.h | 42 ++------------ lib/csapi/keys.h | 17 ++---- lib/csapi/kicking.h | 1 - lib/csapi/leaving.h | 2 - lib/csapi/list_public_rooms.cpp | 4 +- lib/csapi/list_public_rooms.h | 71 +++++++---------------- lib/csapi/login.h | 14 ++++- lib/csapi/message_pagination.h | 1 - lib/csapi/notifications.h | 1 - lib/csapi/openid.h | 5 +- lib/csapi/peeking_events.h | 1 - lib/csapi/presence.h | 2 - lib/csapi/profile.h | 5 -- lib/csapi/pusher.h | 1 - lib/csapi/pushrules.h | 9 +-- lib/csapi/read_markers.h | 1 - lib/csapi/receipts.h | 1 - lib/csapi/redaction.h | 1 - lib/csapi/registration.cpp | 2 +- lib/csapi/registration.h | 23 +++----- lib/csapi/report_content.h | 1 - lib/csapi/room_send.h | 1 - lib/csapi/room_state.h | 1 - lib/csapi/room_upgrades.h | 1 - lib/csapi/rooms.h | 9 +-- lib/csapi/sso_login_redirect.h | 1 - lib/csapi/tags.h | 3 - lib/csapi/third_party_lookup.h | 7 +-- lib/csapi/third_party_membership.h | 1 - lib/csapi/to_device.h | 1 - lib/csapi/typing.h | 1 - lib/csapi/users.h | 16 ++--- 46 files changed, 89 insertions(+), 241 deletions(-) diff --git a/lib/csapi/account-data.h b/lib/csapi/account-data.h index 1c7b555b..9a31596f 100644 --- a/lib/csapi/account-data.h +++ b/lib/csapi/account-data.h @@ -17,7 +17,6 @@ namespace Quotient { class SetAccountDataJob : public BaseJob { public: /*! \brief Set some account_data for the user. - * * * \param userId * The ID of the user to set account_data for. The access token must be @@ -42,7 +41,6 @@ public: class GetAccountDataJob : public BaseJob { public: /*! \brief Get some account_data for the user. - * * * \param userId * The ID of the user to get account_data for. The access token must be @@ -72,7 +70,6 @@ public: class SetAccountDataPerRoomJob : public BaseJob { public: /*! \brief Set some account_data for the user. - * * * \param userId * The ID of the user to set account_data for. The access token must be @@ -101,7 +98,6 @@ public: class GetAccountDataPerRoomJob : public BaseJob { public: /*! \brief Get some account_data for the user. - * * * \param userId * The ID of the user to set account_data for. The access token must be diff --git a/lib/csapi/admin.h b/lib/csapi/admin.h index 6ad7d08d..570bf24a 100644 --- a/lib/csapi/admin.h +++ b/lib/csapi/admin.h @@ -58,7 +58,6 @@ public: // Construction/destruction /*! \brief Gets information about a particular user. - * * * \param userId * The user to look up. diff --git a/lib/csapi/administrative_contact.h b/lib/csapi/administrative_contact.h index 53c89272..1966d533 100644 --- a/lib/csapi/administrative_contact.h +++ b/lib/csapi/administrative_contact.h @@ -4,9 +4,9 @@ #pragma once -#include "csapi/./definitions/request_email_validation.h" -#include "csapi/./definitions/request_msisdn_validation.h" #include "csapi/definitions/auth_data.h" +#include "csapi/definitions/request_email_validation.h" +#include "csapi/definitions/request_msisdn_validation.h" #include "csapi/definitions/request_token_response.h" #include "jobs/basejob.h" @@ -123,7 +123,6 @@ public: // Construction/destruction /*! \brief Adds contact information to the user's account. - * * * \param threePidCreds * The third party credentials to associate with the account. @@ -157,7 +156,6 @@ struct JsonObjectConverter { class Add3PIDJob : public BaseJob { public: /*! \brief Adds contact information to the user's account. - * * * \param clientSecret * The client secret used in the session with the homeserver. @@ -186,7 +184,6 @@ public: class Bind3PIDJob : public BaseJob { public: /*! \brief Binds a 3PID to the user's account through an Identity Service. - * * * \param clientSecret * The client secret used in the session with the identity server. @@ -216,7 +213,6 @@ public: class Delete3pidFromAccountJob : public BaseJob { public: /*! \brief Deletes a third party identifier from the user's account - * * * \param medium * The medium of the third party identifier being removed. @@ -260,7 +256,6 @@ public: class Unbind3pidFromAccountJob : public BaseJob { public: /*! \brief Removes a user's third party identifier from an identity server. - * * * \param medium * The medium of the third party identifier being removed. @@ -307,7 +302,6 @@ public: /*! \brief Begins the validation process for an email address for * association with the user's account. * - * * \param body * The homeserver must check that the given email address is **not** * already associated with an account on this homeserver. This API should @@ -324,7 +318,7 @@ public: /// An email was sent to the given address. Note that this may be an /// email containing the validation token or it may be informing the /// user of an error. - RequestTokenResponse data() const + RequestTokenResponse response() const { return fromJson(jsonData()); } @@ -346,7 +340,6 @@ public: /*! \brief Begins the validation process for a phone number for association * with the user's account. * - * * \param body * The homeserver must check that the given phone number is **not** * already associated with an account on this homeserver. This API should @@ -361,7 +354,7 @@ public: // Result properties /// An SMS message was sent to the given phone number. - RequestTokenResponse data() const + RequestTokenResponse response() const { return fromJson(jsonData()); } diff --git a/lib/csapi/appservice_room_directory.h b/lib/csapi/appservice_room_directory.h index d103177c..3fa02a07 100644 --- a/lib/csapi/appservice_room_directory.h +++ b/lib/csapi/appservice_room_directory.h @@ -26,7 +26,6 @@ public: /*! \brief Updates a room's visibility in the application service's room * directory. * - * * \param networkId * The protocol (network) ID to update the room list for. This would * have been provided by the application service as being listed as diff --git a/lib/csapi/banning.h b/lib/csapi/banning.h index 4faaaa81..37ae91ee 100644 --- a/lib/csapi/banning.h +++ b/lib/csapi/banning.h @@ -21,7 +21,6 @@ namespace Quotient { class BanJob : public BaseJob { public: /*! \brief Ban a user in the room. - * * * \param roomId * The room identifier (not alias) from which the user should be banned. @@ -49,7 +48,6 @@ public: class UnbanJob : public BaseJob { public: /*! \brief Unban a user from the room. - * * * \param roomId * The room identifier (not alias) from which the user should be unbanned. diff --git a/lib/csapi/content-repo.h b/lib/csapi/content-repo.h index 0eb273bc..ed67485c 100644 --- a/lib/csapi/content-repo.h +++ b/lib/csapi/content-repo.h @@ -17,7 +17,6 @@ namespace Quotient { class UploadContentJob : public BaseJob { public: /*! \brief Upload some content to the content repository. - * * * \param content * The content to be uploaded. @@ -46,7 +45,6 @@ public: class GetContentJob : public BaseJob { public: /*! \brief Download content from the content repository. - * * * \param serverName * The server name from the ``mxc://`` URI (the authoritory component) @@ -85,15 +83,16 @@ public: QIODevice* data() { return reply(); } }; -/*! \brief Download content from the content repository. This is the same as -the download endpoint above, except permitting a desired file name. +/*! \brief Download content from the content repository overriding the file name * + * This will download content from the content repository (same as + * the previous endpoint) but replace the target file name with the one + * provided by the caller. */ class GetContentOverrideNameJob : public BaseJob { public: - /*! \brief Download content from the content repository. This is the same as -the download endpoint above, except permitting a desired file name. - * + /*! \brief Download content from the content repository overriding the file + * name * * \param serverName * The server name from the ``mxc://`` URI (the authoritory component) @@ -106,10 +105,8 @@ the download endpoint above, except permitting a desired file name. * * \param allowRemote * Indicates to the server that it should not attempt to fetch the media -if it is deemed - * remote. This is to prevent routing loops where the server contacts -itself. Defaults to - * true if not provided. + * if it is deemed remote. This is to prevent routing loops where the server + * contacts itself. Defaults to true if not provided. */ explicit GetContentOverrideNameJob(const QString& serverName, const QString& mediaId, @@ -141,15 +138,14 @@ itself. Defaults to QIODevice* data() { return reply(); } }; -/*! \brief Download a thumbnail of content from the content repository. See the -`thumbnailing <#thumbnails>`_ section for more information. +/*! \brief Download a thumbnail of content from the content repository * + * Download a thumbnail of content from the content repository. + * See the `thumbnailing <#thumbnails>`_ section for more information. */ class GetContentThumbnailJob : public BaseJob { public: - /*! \brief Download a thumbnail of content from the content repository. See -the `thumbnailing <#thumbnails>`_ section for more information. - * + /*! \brief Download a thumbnail of content from the content repository * * \param serverName * The server name from the ``mxc://`` URI (the authoritory component) @@ -170,11 +166,9 @@ the `thumbnailing <#thumbnails>`_ section for more information. * section for more information. * * \param allowRemote - * Indicates to the server that it should not attempt to fetch the media -if it is deemed - * remote. This is to prevent routing loops where the server contacts -itself. Defaults to - * true if not provided. + * Indicates to the server that it should not attempt to fetch + * the media if it is deemed remote. This is to prevent routing loops + * where the server contacts itself. Defaults to true if not provided. */ explicit GetContentThumbnailJob(const QString& serverName, const QString& mediaId, int width, @@ -214,7 +208,6 @@ itself. Defaults to class GetUrlPreviewJob : public BaseJob { public: /*! \brief Get information about a URL for a client - * * * \param url * The URL to get a preview of. diff --git a/lib/csapi/create_room.h b/lib/csapi/create_room.h index 82db9e59..6a718ff4 100644 --- a/lib/csapi/create_room.h +++ b/lib/csapi/create_room.h @@ -189,7 +189,6 @@ public: // Construction/destruction /*! \brief Create a new room - * * * \param visibility * A ``public`` visibility indicates that the room will be shown diff --git a/lib/csapi/definitions/request_email_validation.h b/lib/csapi/definitions/request_email_validation.h index e6ab261d..ab34862e 100644 --- a/lib/csapi/definitions/request_email_validation.h +++ b/lib/csapi/definitions/request_email_validation.h @@ -6,7 +6,7 @@ #include "converters.h" -#include "csapi/./definitions/../../identity/definitions/request_email_validation.h" +#include "csapi/definitions/../../identity/definitions/request_email_validation.h" namespace Quotient { diff --git a/lib/csapi/definitions/request_msisdn_validation.h b/lib/csapi/definitions/request_msisdn_validation.h index 6f161f00..8539cd98 100644 --- a/lib/csapi/definitions/request_msisdn_validation.h +++ b/lib/csapi/definitions/request_msisdn_validation.h @@ -6,7 +6,7 @@ #include "converters.h" -#include "csapi/./definitions/../../identity/definitions/request_msisdn_validation.h" +#include "csapi/definitions/../../identity/definitions/request_msisdn_validation.h" namespace Quotient { diff --git a/lib/csapi/device_management.h b/lib/csapi/device_management.h index 0abd5b84..47dc7ec8 100644 --- a/lib/csapi/device_management.h +++ b/lib/csapi/device_management.h @@ -43,7 +43,6 @@ public: class GetDeviceJob : public BaseJob { public: /*! \brief Get a single device - * * * \param deviceId * The device to retrieve. @@ -60,7 +59,7 @@ public: // Result properties /// Device information - Device data() const { return fromJson(jsonData()); } + Device device() const { return fromJson(jsonData()); } }; /*! \brief Update a device @@ -70,7 +69,6 @@ public: class UpdateDeviceJob : public BaseJob { public: /*! \brief Update a device - * * * \param deviceId * The device to update. @@ -92,7 +90,6 @@ public: class DeleteDeviceJob : public BaseJob { public: /*! \brief Delete a device - * * * \param deviceId * The device to delete. @@ -115,7 +112,6 @@ public: class DeleteDevicesJob : public BaseJob { public: /*! \brief Bulk deletion of devices - * * * \param devices * The list of device IDs to delete. diff --git a/lib/csapi/directory.h b/lib/csapi/directory.h index 7ae44d1d..9b109aad 100644 --- a/lib/csapi/directory.h +++ b/lib/csapi/directory.h @@ -14,7 +14,6 @@ namespace Quotient { class SetRoomAliasJob : public BaseJob { public: /*! \brief Create a new mapping from room alias to room ID. - * * * \param roomAlias * The room alias to set. @@ -36,7 +35,6 @@ public: class GetRoomIdByAliasJob : public BaseJob { public: /*! \brief Get the room ID corresponding to this room alias. - * * * \param roomAlias * The room alias. @@ -81,7 +79,6 @@ public: class DeleteRoomAliasJob : public BaseJob { public: /*! \brief Remove a mapping of room alias to room ID. - * * * \param roomAlias * The room alias to remove. @@ -118,7 +115,6 @@ public: class GetLocalAliasesJob : public BaseJob { public: /*! \brief Get a list of local aliases on a given room. - * * * \param roomId * The room ID to find local aliases of. diff --git a/lib/csapi/event_context.h b/lib/csapi/event_context.h index 2f9c66d8..d82d16ab 100644 --- a/lib/csapi/event_context.h +++ b/lib/csapi/event_context.h @@ -22,7 +22,6 @@ namespace Quotient { class GetEventContextJob : public BaseJob { public: /*! \brief Get events and state around the specified event. - * * * \param roomId * The room to get events from. diff --git a/lib/csapi/filter.h b/lib/csapi/filter.h index 9aa7dc79..f07b489c 100644 --- a/lib/csapi/filter.h +++ b/lib/csapi/filter.h @@ -19,7 +19,6 @@ namespace Quotient { class DefineFilterJob : public BaseJob { public: /*! \brief Upload a new filter. - * * * \param userId * The id of the user uploading the filter. The access token must be @@ -45,7 +44,6 @@ public: class GetFilterJob : public BaseJob { public: /*! \brief Download a filter - * * * \param userId * The user ID to download a filter for. @@ -65,8 +63,8 @@ public: // Result properties - /// "The filter defintion" - Filter data() const { return fromJson(jsonData()); } + /// The filter definition. + Filter filter() const { return fromJson(jsonData()); } }; } // namespace Quotient diff --git a/lib/csapi/inviting.h b/lib/csapi/inviting.h index a7ec6093..59a61b89 100644 --- a/lib/csapi/inviting.h +++ b/lib/csapi/inviting.h @@ -32,7 +32,6 @@ namespace Quotient { class InviteUserJob : public BaseJob { public: /*! \brief Invite a user to participate in a particular room. - * * * \param roomId * The room identifier (not alias) to which to invite the user. diff --git a/lib/csapi/joining.h b/lib/csapi/joining.h index 6822fbdf..dd936f92 100644 --- a/lib/csapi/joining.h +++ b/lib/csapi/joining.h @@ -12,8 +12,8 @@ namespace Quotient { /*! \brief Start the requesting user participating in a particular room. * - * *Note that this API requires a room ID, not alias.* ``/join/{roomIdOrAlias}`` - * *exists if you have a room alias.* + * *Note that this API requires a room ID, not alias.* + * ``/join/{roomIdOrAlias}`` *exists if you have a room alias.* * * This API starts a user participating in a particular room, if that user * is allowed to participate in that room. After this call, the client is @@ -22,34 +22,18 @@ namespace Quotient { * * After a user has joined a room, the room will appear as an entry in the * response of the |/initialSync|_ and |/sync|_ APIs. - * - * If a ``third_party_signed`` was supplied, the homeserver must verify - * that it matches a pending ``m.room.third_party_invite`` event in the - * room, and perform key validity checking if required by the event. */ class JoinRoomByIdJob : public BaseJob { public: /*! \brief Start the requesting user participating in a particular room. - * * * \param roomId * The room identifier (not alias) to join. * * \param thirdPartySigned - * *Note that this API requires a room ID, not alias.* - * ``/join/{roomIdOrAlias}`` *exists if you have a room alias.* - * - * This API starts a user participating in a particular room, if that user - * is allowed to participate in that room. After this call, the client is - * allowed to see all current state events in the room, and all subsequent - * events associated with the room until the user leaves the room. - * - * After a user has joined a room, the room will appear as an entry in the - * response of the |/initialSync|_ and |/sync|_ APIs. - * - * If a ``third_party_signed`` was supplied, the homeserver must verify - * that it matches a pending ``m.room.third_party_invite`` event in the - * room, and perform key validity checking if required by the event. + * If supplied, the homeserver must verify that it matches a pending + * ``m.room.third_party_invite`` event in the room, and perform + * key validity checking if required by the event. */ explicit JoinRoomByIdJob( const QString& roomId, @@ -73,15 +57,10 @@ public: * * After a user has joined a room, the room will appear as an entry in the * response of the |/initialSync|_ and |/sync|_ APIs. - * - * If a ``third_party_signed`` was supplied, the homeserver must verify - * that it matches a pending ``m.room.third_party_invite`` event in the - * room, and perform key validity checking if required by the event. */ class JoinRoomJob : public BaseJob { public: /*! \brief Start the requesting user participating in a particular room. - * * * \param roomIdOrAlias * The room identifier or alias to join. @@ -91,17 +70,6 @@ public: * must be participating in the room. * * \param thirdPartySigned - * *Note that this API takes either a room ID or alias, unlike* - * ``/room/{roomId}/join``. - * - * This API starts a user participating in a particular room, if that user - * is allowed to participate in that room. After this call, the client is - * allowed to see all current state events in the room, and all subsequent - * events associated with the room until the user leaves the room. - * - * After a user has joined a room, the room will appear as an entry in the - * response of the |/initialSync|_ and |/sync|_ APIs. - * * If a ``third_party_signed`` was supplied, the homeserver must verify * that it matches a pending ``m.room.third_party_invite`` event in the * room, and perform key validity checking if required by the event. diff --git a/lib/csapi/keys.h b/lib/csapi/keys.h index b7a8dc71..8f6c8cc9 100644 --- a/lib/csapi/keys.h +++ b/lib/csapi/keys.h @@ -17,7 +17,6 @@ namespace Quotient { class UploadKeysJob : public BaseJob { public: /*! \brief Upload end-to-end encryption keys. - * * * \param deviceKeys * Identity keys for the device. May be absent if no new @@ -61,9 +60,7 @@ public: }; /// Returns the current devices and identity keys for the given users. - struct DeviceKeys : - - Quotient::DeviceKeys { + struct DeviceInformation : DeviceKeys { /// Additional data added to the device key information /// by intermediate servers, and not covered by the /// signatures. @@ -73,7 +70,6 @@ public: // Construction/destruction /*! \brief Download device identity keys. - * * * \param deviceKeys * The keys to be downloaded. A map from user ID, to a list of @@ -113,9 +109,9 @@ public: /// the information returned will be the same as uploaded via /// ``/keys/upload``, with the addition of an ``unsigned`` /// property. - QHash> deviceKeys() const + QHash> deviceKeys() const { - return loadFromJson>>( + return loadFromJson>>( "device_keys"_ls); } }; @@ -130,8 +126,9 @@ struct JsonObjectConverter { }; template <> -struct JsonObjectConverter { - static void fillFrom(const QJsonObject& jo, QueryKeysJob::DeviceKeys& result) +struct JsonObjectConverter { + static void fillFrom(const QJsonObject& jo, + QueryKeysJob::DeviceInformation& result) { fillFromJson(jo, result); fromJson(jo.value("unsigned"_ls), result.unsignedData); @@ -145,7 +142,6 @@ struct JsonObjectConverter { class ClaimKeysJob : public BaseJob { public: /*! \brief Claim one-time encryption keys. - * * * \param oneTimeKeys * The keys to be claimed. A map from user ID, to a map from @@ -201,7 +197,6 @@ public: class GetKeysChangesJob : public BaseJob { public: /*! \brief Query users with recent device key updates. - * * * \param from * The desired start point of the list. Should be the ``next_batch`` field diff --git a/lib/csapi/kicking.h b/lib/csapi/kicking.h index 594f5845..2645a54f 100644 --- a/lib/csapi/kicking.h +++ b/lib/csapi/kicking.h @@ -23,7 +23,6 @@ namespace Quotient { class KickJob : public BaseJob { public: /*! \brief Kick a user from the room. - * * * \param roomId * The room identifier (not alias) from which the user should be kicked. diff --git a/lib/csapi/leaving.h b/lib/csapi/leaving.h index 0a4c401c..1bea7e41 100644 --- a/lib/csapi/leaving.h +++ b/lib/csapi/leaving.h @@ -25,7 +25,6 @@ namespace Quotient { class LeaveRoomJob : public BaseJob { public: /*! \brief Stop the requesting user participating in a particular room. - * * * \param roomId * The room identifier to leave. @@ -55,7 +54,6 @@ public: class ForgetRoomJob : public BaseJob { public: /*! \brief Stop the requesting user remembering about a particular room. - * * * \param roomId * The room identifier to forget. diff --git a/lib/csapi/list_public_rooms.cpp b/lib/csapi/list_public_rooms.cpp index cdc5c716..415d816c 100644 --- a/lib/csapi/list_public_rooms.cpp +++ b/lib/csapi/list_public_rooms.cpp @@ -60,7 +60,9 @@ GetPublicRoomsJob::GetPublicRoomsJob(Omittable limit, const QString& since, : BaseJob(HttpVerb::Get, QStringLiteral("GetPublicRoomsJob"), QStringLiteral("/_matrix/client/r0") % "/publicRooms", queryToGetPublicRooms(limit, since, server), {}, false) -{} +{ + addExpectedKey("chunk"); +} auto queryToQueryPublicRooms(const QString& server) { diff --git a/lib/csapi/list_public_rooms.h b/lib/csapi/list_public_rooms.h index 5ef7c23e..b0cb79d2 100644 --- a/lib/csapi/list_public_rooms.h +++ b/lib/csapi/list_public_rooms.h @@ -17,7 +17,6 @@ namespace Quotient { class GetRoomVisibilityOnDirectoryJob : public BaseJob { public: /*! \brief Gets the visibility of a room in the directory - * * * \param roomId * The room ID. @@ -52,7 +51,6 @@ public: class SetRoomVisibilityOnDirectoryJob : public BaseJob { public: /*! \brief Sets the visibility of a room in the room directory - * * * \param roomId * The room ID. @@ -75,7 +73,6 @@ public: class GetPublicRoomsJob : public BaseJob { public: /*! \brief Lists the public rooms on the server. - * * * \param limit * Limit the number of results returned. @@ -105,10 +102,27 @@ public: // Result properties - /// A list of the rooms on the server. - PublicRoomsResponse data() const + /// A paginated chunk of public rooms. + QVector chunk() const { - return fromJson(jsonData()); + return loadFromJson>("chunk"_ls); + } + + /// 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. + QString nextBatch() const { return loadFromJson("next_batch"_ls); } + + /// 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. + QString prevBatch() const { return loadFromJson("prev_batch"_ls); } + + /// An estimate on the total number of public rooms, if the + /// server has an estimate. + Omittable totalRoomCountEstimate() const + { + return loadFromJson>("total_room_count_estimate"_ls); } }; @@ -130,37 +144,9 @@ public: 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. - int 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 /*! \brief Lists the public rooms on the server with optional filter. - * * * \param server * The server to fetch the public room lists from. Defaults to the @@ -228,21 +214,4 @@ struct JsonObjectConverter { } }; -template <> -struct JsonObjectConverter { - static void fillFrom(const QJsonObject& jo, - QueryPublicRoomsJob::PublicRoomsChunk& result) - { - fromJson(jo.value("aliases"_ls), result.aliases); - fromJson(jo.value("canonical_alias"_ls), result.canonicalAlias); - fromJson(jo.value("name"_ls), result.name); - fromJson(jo.value("num_joined_members"_ls), result.numJoinedMembers); - fromJson(jo.value("room_id"_ls), result.roomId); - fromJson(jo.value("topic"_ls), result.topic); - fromJson(jo.value("world_readable"_ls), result.worldReadable); - fromJson(jo.value("guest_can_join"_ls), result.guestCanJoin); - fromJson(jo.value("avatar_url"_ls), result.avatarUrl); - } -}; - } // namespace Quotient diff --git a/lib/csapi/login.h b/lib/csapi/login.h index 0483b77c..a406fc79 100644 --- a/lib/csapi/login.h +++ b/lib/csapi/login.h @@ -75,13 +75,21 @@ struct JsonObjectConverter { class LoginJob : public BaseJob { public: /*! \brief Authenticates the user. - * * * \param type * The login type being used. * * \param identifier - * Identification information for the user. + * Authenticates the user, and issues an access token they can + * use to authorize themself in subsequent requests. + * + * If the client does not supply a ``device_id``, the server must + * auto-generate one. + * + * The returned access token must be associated with the ``device_id`` + * supplied by the client or generated by the server. The server may + * invalidate any access token previously associated with that device. See + * `Relationship between access tokens and devices`_. * * \param password * Required when ``type`` is ``m.login.password``. The user's @@ -108,7 +116,7 @@ public: // Result properties - /// The fully-qualified Matrix ID that has been registered. + /// The fully-qualified Matrix ID for the account. QString userId() const { return loadFromJson("user_id"_ls); } /// An access token for the account. diff --git a/lib/csapi/message_pagination.h b/lib/csapi/message_pagination.h index e9f9e6d4..286d4237 100644 --- a/lib/csapi/message_pagination.h +++ b/lib/csapi/message_pagination.h @@ -21,7 +21,6 @@ namespace Quotient { class GetRoomEventsJob : public BaseJob { public: /*! \brief Get a list of events for this room - * * * \param roomId * The room to get events from. diff --git a/lib/csapi/notifications.h b/lib/csapi/notifications.h index 095e9325..ff499c7a 100644 --- a/lib/csapi/notifications.h +++ b/lib/csapi/notifications.h @@ -41,7 +41,6 @@ public: // Construction/destruction /*! \brief Gets a list of events that the user has been notified about - * * * \param from * Pagination token given to retrieve the next set of events. diff --git a/lib/csapi/openid.h b/lib/csapi/openid.h index e69f9ad0..efb5f623 100644 --- a/lib/csapi/openid.h +++ b/lib/csapi/openid.h @@ -24,7 +24,6 @@ namespace Quotient { class RequestOpenIdTokenJob : public BaseJob { public: /*! \brief Get an OpenID token object to verify the requester's identity. - * * * \param userId * The user to request and OpenID token for. Should be the user who @@ -39,11 +38,11 @@ public: // Result properties /// OpenID token information. This response is nearly compatible with the - /// response documented in the `OpenID 1.0 Specification + /// response documented in the `OpenID Connect 1.0 Specification /// `_ /// with the only difference being the lack of an ``id_token``. Instead, /// the Matrix homeserver's name is provided. - OpenidToken data() const { return fromJson(jsonData()); } + OpenidToken tokenData() const { return fromJson(jsonData()); } }; } // namespace Quotient diff --git a/lib/csapi/peeking_events.h b/lib/csapi/peeking_events.h index bfb9e24a..cecd9f2d 100644 --- a/lib/csapi/peeking_events.h +++ b/lib/csapi/peeking_events.h @@ -25,7 +25,6 @@ namespace Quotient { class PeekEventsJob : public BaseJob { public: /*! \brief Listen on the event stream. - * * * \param from * The token to stream from. This token is either from a previous diff --git a/lib/csapi/presence.h b/lib/csapi/presence.h index b34028e7..a885bf4f 100644 --- a/lib/csapi/presence.h +++ b/lib/csapi/presence.h @@ -18,7 +18,6 @@ namespace Quotient { class SetPresenceJob : public BaseJob { public: /*! \brief Update this user's presence state. - * * * \param userId * The user whose presence state to update. @@ -40,7 +39,6 @@ public: class GetPresenceJob : public BaseJob { public: /*! \brief Get this user's presence state. - * * * \param userId * The user whose presence state to get. diff --git a/lib/csapi/profile.h b/lib/csapi/profile.h index 5b0d06d9..88bf3166 100644 --- a/lib/csapi/profile.h +++ b/lib/csapi/profile.h @@ -16,7 +16,6 @@ namespace Quotient { class SetDisplayNameJob : public BaseJob { public: /*! \brief Set the user's display name. - * * * \param userId * The user whose display name to set. @@ -37,7 +36,6 @@ public: class GetDisplayNameJob : public BaseJob { public: /*! \brief Get the user's display name. - * * * \param userId * The user whose display name to get. @@ -68,7 +66,6 @@ public: class SetAvatarUrlJob : public BaseJob { public: /*! \brief Set the user's avatar URL. - * * * \param userId * The user whose avatar URL to set. @@ -89,7 +86,6 @@ public: class GetAvatarUrlJob : public BaseJob { public: /*! \brief Get the user's avatar URL. - * * * \param userId * The user whose avatar URL to get. @@ -119,7 +115,6 @@ public: class GetUserProfileJob : public BaseJob { public: /*! \brief Get this user's profile information. - * * * \param userId * The user whose profile information to get. diff --git a/lib/csapi/pusher.h b/lib/csapi/pusher.h index 40cd5796..ae0050d2 100644 --- a/lib/csapi/pusher.h +++ b/lib/csapi/pusher.h @@ -131,7 +131,6 @@ public: // Construction/destruction /*! \brief Modify a pusher for this user on the homeserver. - * * * \param pushkey * This is a unique identifier for this pusher. The value you diff --git a/lib/csapi/pushrules.h b/lib/csapi/pushrules.h index 0971dc6b..f6d3458a 100644 --- a/lib/csapi/pushrules.h +++ b/lib/csapi/pushrules.h @@ -47,7 +47,6 @@ public: class GetPushRuleJob : public BaseJob { public: /*! \brief Retrieve a push rule. - * * * \param scope * ``global`` to specify global rules. @@ -73,7 +72,7 @@ public: /// The specific push rule. This will also include keys specific to the /// rule itself such as the rule's ``actions`` and ``conditions`` if set. - PushRule data() const { return fromJson(jsonData()); } + PushRule pushRule() const { return fromJson(jsonData()); } }; /*! \brief Delete a push rule. @@ -83,7 +82,6 @@ public: class DeletePushRuleJob : public BaseJob { public: /*! \brief Delete a push rule. - * * * \param scope * ``global`` to specify global rules. @@ -117,7 +115,6 @@ public: class SetPushRuleJob : public BaseJob { public: /*! \brief Add or change a push rule. - * * * \param scope * ``global`` to specify global rules. @@ -165,7 +162,6 @@ public: class IsPushRuleEnabledJob : public BaseJob { public: /*! \brief Get whether a push rule is enabled - * * * \param scope * Either ``global`` or ``device/`` to specify global @@ -201,7 +197,6 @@ public: class SetPushRuleEnabledJob : public BaseJob { public: /*! \brief Enable or disable a push rule. - * * * \param scope * ``global`` to specify global rules. @@ -226,7 +221,6 @@ public: class GetPushRuleActionsJob : public BaseJob { public: /*! \brief The actions for a push rule - * * * \param scope * Either ``global`` or ``device/`` to specify global @@ -266,7 +260,6 @@ public: class SetPushRuleActionsJob : public BaseJob { public: /*! \brief Set the actions for a push rule. - * * * \param scope * ``global`` to specify global rules. diff --git a/lib/csapi/read_markers.h b/lib/csapi/read_markers.h index addb9123..0e122c63 100644 --- a/lib/csapi/read_markers.h +++ b/lib/csapi/read_markers.h @@ -16,7 +16,6 @@ namespace Quotient { class SetReadMarkerJob : public BaseJob { public: /*! \brief Set the position of the read marker for a room. - * * * \param roomId * The room ID to set the read marker in for the user. diff --git a/lib/csapi/receipts.h b/lib/csapi/receipts.h index fdec3b88..1fac0acf 100644 --- a/lib/csapi/receipts.h +++ b/lib/csapi/receipts.h @@ -16,7 +16,6 @@ namespace Quotient { class PostReceiptJob : public BaseJob { public: /*! \brief Send a receipt for the given event ID. - * * * \param roomId * The room in which to send the event. diff --git a/lib/csapi/redaction.h b/lib/csapi/redaction.h index c737de41..541e433a 100644 --- a/lib/csapi/redaction.h +++ b/lib/csapi/redaction.h @@ -22,7 +22,6 @@ namespace Quotient { class RedactEventJob : public BaseJob { public: /*! \brief Strips all non-integrity-critical information out of an event. - * * * \param roomId * The room from which to redact the event. diff --git a/lib/csapi/registration.cpp b/lib/csapi/registration.cpp index 9f88ef28..b80abc84 100644 --- a/lib/csapi/registration.cpp +++ b/lib/csapi/registration.cpp @@ -82,7 +82,7 @@ RequestTokenToResetPasswordEmailJob::RequestTokenToResetPasswordEmailJob( } RequestTokenToResetPasswordMSISDNJob::RequestTokenToResetPasswordMSISDNJob( - const RequestMsisdnValidation& body) + const MsisdnValidationData& body) : BaseJob(HttpVerb::Post, QStringLiteral("RequestTokenToResetPasswordMSISDNJob"), QStringLiteral("/_matrix/client/r0") diff --git a/lib/csapi/registration.h b/lib/csapi/registration.h index 9d96db32..62bc35f1 100644 --- a/lib/csapi/registration.h +++ b/lib/csapi/registration.h @@ -4,10 +4,9 @@ #pragma once -#include "csapi/../identity/definitions/request_msisdn_validation.h" -#include "csapi/./definitions/request_email_validation.h" -#include "csapi/./definitions/request_msisdn_validation.h" #include "csapi/definitions/auth_data.h" +#include "csapi/definitions/request_email_validation.h" +#include "csapi/definitions/request_msisdn_validation.h" #include "csapi/definitions/request_token_response.h" #include "jobs/basejob.h" @@ -61,7 +60,6 @@ namespace Quotient { class RegisterJob : public BaseJob { public: /*! \brief Register for an account on this homeserver. - * * * \param kind * The kind of account to register. Defaults to ``user``. @@ -148,7 +146,6 @@ public: /*! \brief Begins the validation process for an email to be used during * registration. * - * * \param body * The homeserver must check that the given email address is **not** * already associated with an account on this homeserver. The homeserver @@ -162,7 +159,7 @@ public: /// An email has been sent to the specified address. Note that this /// may be an email containing the validation token or it may be /// informing the user of an error. - RequestTokenResponse data() const + RequestTokenResponse response() const { return fromJson(jsonData()); } @@ -181,7 +178,6 @@ public: /*! \brief Requests a validation token be sent to the given phone number for * the purpose of registering an account * - * * \param body * The homeserver must check that the given phone number is **not** * already associated with an account on this homeserver. The homeserver @@ -195,7 +191,7 @@ public: /// An SMS message has been sent to the specified phone number. Note /// that this may be an SMS message containing the validation token or /// it may be informing the user of an error. - RequestTokenResponse data() const + RequestTokenResponse response() const { return fromJson(jsonData()); } @@ -220,7 +216,6 @@ public: class ChangePasswordJob : public BaseJob { public: /*! \brief Changes a user's password. - * * * \param newPassword * The new password for the account. @@ -270,7 +265,6 @@ public: /*! \brief Requests a validation token be sent to the given email address * for the purpose of resetting a user's password * - * * \param body * The homeserver must check that the given email address **is * associated** with an account on this homeserver. This API should be @@ -299,7 +293,7 @@ public: // Result properties /// An email was sent to the given address. - RequestTokenResponse data() const + RequestTokenResponse response() const { return fromJson(jsonData()); } @@ -333,7 +327,6 @@ public: /*! \brief Requests a validation token be sent to the given phone number for * the purpose of resetting a user's password. * - * * \param body * The homeserver must check that the given phone number **is * associated** with an account on this homeserver. This API should be @@ -357,12 +350,12 @@ public: * #post-matrix-client-r0-register-email-requesttoken */ explicit RequestTokenToResetPasswordMSISDNJob( - const RequestMsisdnValidation& body); + const MsisdnValidationData& body); // Result properties /// An SMS message was sent to the given phone number. - RequestTokenResponse data() const + RequestTokenResponse response() const { return fromJson(jsonData()); } @@ -388,7 +381,6 @@ public: class DeactivateAccountJob : public BaseJob { public: /*! \brief Deactivate a user's account. - * * * \param auth * Additional authentication information for the user-interactive @@ -439,7 +431,6 @@ public: class CheckUsernameAvailabilityJob : public BaseJob { public: /*! \brief Checks to see if a username is available on the server. - * * * \param username * The username to check the availability of. diff --git a/lib/csapi/report_content.h b/lib/csapi/report_content.h index 13dc9138..375e1829 100644 --- a/lib/csapi/report_content.h +++ b/lib/csapi/report_content.h @@ -16,7 +16,6 @@ namespace Quotient { class ReportContentJob : public BaseJob { public: /*! \brief Reports an event as inappropriate. - * * * \param roomId * The room in which the event being reported is located. diff --git a/lib/csapi/room_send.h b/lib/csapi/room_send.h index b1905e53..39460aca 100644 --- a/lib/csapi/room_send.h +++ b/lib/csapi/room_send.h @@ -21,7 +21,6 @@ namespace Quotient { class SendMessageJob : public BaseJob { public: /*! \brief Send a message event to the given room. - * * * \param roomId * The room to send the event to. diff --git a/lib/csapi/room_state.h b/lib/csapi/room_state.h index eeb2b33c..447605ff 100644 --- a/lib/csapi/room_state.h +++ b/lib/csapi/room_state.h @@ -34,7 +34,6 @@ namespace Quotient { class SetRoomStateWithKeyJob : public BaseJob { public: /*! \brief Send a state event to the given room. - * * * \param roomId * The room to set the state in diff --git a/lib/csapi/room_upgrades.h b/lib/csapi/room_upgrades.h index 53601816..58327587 100644 --- a/lib/csapi/room_upgrades.h +++ b/lib/csapi/room_upgrades.h @@ -15,7 +15,6 @@ namespace Quotient { class UpgradeRoomJob : public BaseJob { public: /*! \brief Upgrades a room to a new room version. - * * * \param roomId * The ID of the room to upgrade. diff --git a/lib/csapi/rooms.h b/lib/csapi/rooms.h index 6137bcbd..f0bfa349 100644 --- a/lib/csapi/rooms.h +++ b/lib/csapi/rooms.h @@ -18,7 +18,6 @@ namespace Quotient { class GetOneRoomEventJob : public BaseJob { public: /*! \brief Get a single event by event ID. - * * * \param roomId * The ID of the room the event is in. @@ -39,7 +38,7 @@ public: // Result properties /// The full event. - EventPtr data() { return fromJson(jsonData()); } + EventPtr event() { return fromJson(jsonData()); } }; /*! \brief Get the state identified by the type and key. @@ -55,7 +54,6 @@ public: class GetRoomStateWithKeyJob : public BaseJob { public: /*! \brief Get the state identified by the type and key. - * * * \param roomId * The room to look up the state in. @@ -88,7 +86,6 @@ public: class GetRoomStateJob : public BaseJob { public: /*! \brief Get all state events in the current state of a room. - * * * \param roomId * The room to look up the state for. @@ -105,7 +102,7 @@ public: // Result properties /// The current state of the room - StateEvents data() { return fromJson(jsonData()); } + StateEvents events() { return fromJson(jsonData()); } }; /*! \brief Get the m.room.member events for the room. @@ -115,7 +112,6 @@ public: class GetMembersByRoomJob : public BaseJob { public: /*! \brief Get the m.room.member events for the room. - * * * \param roomId * The room to get the member events for. @@ -189,7 +185,6 @@ public: // Construction/destruction /*! \brief Gets the list of currently joined users and their profile data. - * * * \param roomId * The room to get the members of. diff --git a/lib/csapi/sso_login_redirect.h b/lib/csapi/sso_login_redirect.h index 20f33da2..d6330e38 100644 --- a/lib/csapi/sso_login_redirect.h +++ b/lib/csapi/sso_login_redirect.h @@ -18,7 +18,6 @@ namespace Quotient { class RedirectToSSOJob : public BaseJob { public: /*! \brief Redirect the user's browser to the SSO interface. - * * * \param redirectUrl * URI to which the user will be redirected after the homeserver has diff --git a/lib/csapi/tags.h b/lib/csapi/tags.h index e6eb9dda..a815d9b3 100644 --- a/lib/csapi/tags.h +++ b/lib/csapi/tags.h @@ -28,7 +28,6 @@ public: // Construction/destruction /*! \brief List the tags for a room. - * * * \param userId * The id of the user to get tags for. The access token must be @@ -72,7 +71,6 @@ struct JsonObjectConverter { class SetRoomTagJob : public BaseJob { public: /*! \brief Add a tag to a room. - * * * \param userId * The id of the user to add a tag for. The access token must be @@ -103,7 +101,6 @@ public: class DeleteRoomTagJob : public BaseJob { public: /*! \brief Remove a tag from the room. - * * * \param userId * The id of the user to remove a tag for. The access token must be diff --git a/lib/csapi/third_party_lookup.h b/lib/csapi/third_party_lookup.h index 9329b7a7..969e767c 100644 --- a/lib/csapi/third_party_lookup.h +++ b/lib/csapi/third_party_lookup.h @@ -33,7 +33,7 @@ public: // Result properties /// The protocols supported by the homeserver. - QHash data() const + QHash protocols() const { return fromJson>(jsonData()); } @@ -50,7 +50,6 @@ public: /*! \brief Retrieve metadata about a specific protocol that the homeserver * supports. * - * * \param protocol * The name of the protocol. */ @@ -88,7 +87,6 @@ public: /*! \brief Retrieve Matrix-side portals rooms leading to a third party * location. * - * * \param protocol * The protocol used to communicate to the third party network. * @@ -124,7 +122,6 @@ public: class QueryUserByProtocolJob : public BaseJob { public: /*! \brief Retrieve the Matrix User ID of a corresponding third party user. - * * * \param protocol * The name of the protocol. @@ -161,7 +158,6 @@ public: class QueryLocationByAliasJob : public BaseJob { public: /*! \brief Reverse-lookup third party locations given a Matrix room alias. - * * * \param alias * The Matrix room alias to look up. @@ -191,7 +187,6 @@ public: class QueryUserByIDJob : public BaseJob { public: /*! \brief Reverse-lookup third party users given a Matrix User ID. - * * * \param userid * The Matrix User ID to look up. diff --git a/lib/csapi/third_party_membership.h b/lib/csapi/third_party_membership.h index f8196f6f..55cab370 100644 --- a/lib/csapi/third_party_membership.h +++ b/lib/csapi/third_party_membership.h @@ -58,7 +58,6 @@ namespace Quotient { class InviteBy3PIDJob : public BaseJob { public: /*! \brief Invite a user to participate in a particular room. - * * * \param roomId * The room identifier (not alias) to which to invite the user. diff --git a/lib/csapi/to_device.h b/lib/csapi/to_device.h index 8c82af45..f5d69d65 100644 --- a/lib/csapi/to_device.h +++ b/lib/csapi/to_device.h @@ -16,7 +16,6 @@ namespace Quotient { class SendToDeviceJob : public BaseJob { public: /*! \brief Send an event to a given set of devices. - * * * \param eventType * The type of event to send. diff --git a/lib/csapi/typing.h b/lib/csapi/typing.h index f5b67baf..2c953949 100644 --- a/lib/csapi/typing.h +++ b/lib/csapi/typing.h @@ -18,7 +18,6 @@ namespace Quotient { class SetTypingJob : public BaseJob { public: /*! \brief Informs the server that the user has started or stopped typing. - * * * \param userId * The user who has started to type. diff --git a/lib/csapi/users.h b/lib/csapi/users.h index adb2a33d..6fc26f57 100644 --- a/lib/csapi/users.h +++ b/lib/csapi/users.h @@ -35,7 +35,7 @@ public: /// The search is performed case-insensitively on user IDs and display /// names preferably using a collation determined based upon the /// ``Accept-Language`` header provided in the request, if present. - struct SearchUserDirectory200ThirdPartyUser { + struct User { /// The user's matrix user ID. QString userId; /// The display name of the user, if one exists. @@ -47,7 +47,6 @@ public: // Construction/destruction /*! \brief Searches the user directory. - * * * \param searchTerm * The term to search for @@ -61,10 +60,9 @@ public: // Result properties /// Ordered by rank and then whether or not profile info is available. - QVector results() const + QVector results() const { - return loadFromJson>( - "results"_ls); + return loadFromJson>("results"_ls); } /// Indicates if the result list has been truncated by the limit. @@ -72,11 +70,9 @@ public: }; template <> -struct JsonObjectConverter< - SearchUserDirectoryJob::SearchUserDirectory200ThirdPartyUser> { - static void - fillFrom(const QJsonObject& jo, - SearchUserDirectoryJob::SearchUserDirectory200ThirdPartyUser& result) +struct JsonObjectConverter { + static void fillFrom(const QJsonObject& jo, + SearchUserDirectoryJob::User& result) { fromJson(jo.value("user_id"_ls), result.userId); fromJson(jo.value("display_name"_ls), result.displayName); -- cgit v1.2.3