From aacc4bcb4a487871daae6717f77605aaba444341 Mon Sep 17 00:00:00 2001 From: Marc Deop Date: Sat, 2 Mar 2019 12:26:57 +0100 Subject: style: apply .clang-format to all .cpp and .h files --- lib/csapi/joining.h | 209 ++++++++++++++++++++++++++++------------------------ 1 file changed, 111 insertions(+), 98 deletions(-) (limited to 'lib/csapi/joining.h') diff --git a/lib/csapi/joining.h b/lib/csapi/joining.h index 52c8ea42..5d118dab 100644 --- a/lib/csapi/joining.h +++ b/lib/csapi/joining.h @@ -9,143 +9,156 @@ #include "converters.h" #include -namespace QMatrixClient -{ +namespace QMatrixClient { // Operations /// 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 /// 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. class JoinRoomByIdJob : public BaseJob { public: - // Inner data structures - - /// A signature of an ``m.third_party_invite`` token to prove that this user owns a third party identity which has been invited to the room. - struct ThirdPartySigned - { - /// The Matrix ID of the user who issued the invite. - QString sender; - /// The Matrix ID of the invitee. - QString mxid; - /// The state key of the m.third_party_invite event. - QString token; - /// A signatures object containing a signature of the entire signed object. - QJsonObject signatures; - }; - - // Construction/destruction - - /*! Start the requesting user participating in a particular room. - * \param roomId - * The room identifier (not alias) to join. - * \param thirdPartySigned - * A signature of an ``m.third_party_invite`` token to prove that this user owns a third party identity which has been invited to the room. - */ - explicit JoinRoomByIdJob(const QString& roomId, const Omittable& thirdPartySigned = none); - ~JoinRoomByIdJob() override; - - // Result properties - - /// The joined room ID. - const QString& roomId() const; + // Inner data structures + + /// A signature of an ``m.third_party_invite`` token to prove that this + /// user owns a third party identity which has been invited to the room. + struct ThirdPartySigned { + /// The Matrix ID of the user who issued the invite. + QString sender; + /// The Matrix ID of the invitee. + QString mxid; + /// The state key of the m.third_party_invite event. + QString token; + /// A signatures object containing a signature of the entire signed + /// object. + QJsonObject signatures; + }; + + // Construction/destruction + + /*! Start the requesting user participating in a particular room. + * \param roomId + * The room identifier (not alias) to join. + * \param thirdPartySigned + * A signature of an ``m.third_party_invite`` token to prove that this + * user owns a third party identity which has been invited to the room. + */ + explicit JoinRoomByIdJob( + const QString& roomId, + const Omittable& thirdPartySigned = none); + ~JoinRoomByIdJob() override; + + // Result properties + + /// The joined room ID. + const QString& roomId() const; protected: - Status parseJson(const QJsonDocument& data) override; + Status parseJson(const QJsonDocument& data) override; private: - class Private; - QScopedPointer d; + class Private; + QScopedPointer d; }; /// Start the requesting user participating in a particular room. /// - /// *Note that this API takes either a room ID or alias, unlike* ``/room/{roomId}/join``. - /// + /// *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. class JoinRoomJob : public BaseJob { public: - // Inner data structures - - /// *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. - struct Signed - { - /// The Matrix ID of the user who issued the invite. - QString sender; - /// The Matrix ID of the invitee. - QString mxid; - /// The state key of the m.third_party_invite event. - QString token; - /// A signatures object containing a signature of the entire signed object. - QJsonObject signatures; - }; - - /// A signature of an ``m.third_party_invite`` token to prove that this user owns a third party identity which has been invited to the room. - struct ThirdPartySigned - { - /// A signature of an ``m.third_party_invite`` token to prove that this user owns a third party identity which has been invited to the room. - Signed signedData; - }; - - // Construction/destruction - - /*! Start the requesting user participating in a particular room. - * \param roomIdOrAlias - * The room identifier or alias to join. - * \param serverName - * The servers to attempt to join the room through. One of the servers - * must be participating in the room. - * \param thirdPartySigned - * A signature of an ``m.third_party_invite`` token to prove that this user owns a third party identity which has been invited to the room. - */ - explicit JoinRoomJob(const QString& roomIdOrAlias, const QStringList& serverName = {}, const Omittable& thirdPartySigned = none); - ~JoinRoomJob() override; - - // Result properties - - /// The joined room ID. - const QString& roomId() const; + // Inner data structures + + /// *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. + struct Signed { + /// The Matrix ID of the user who issued the invite. + QString sender; + /// The Matrix ID of the invitee. + QString mxid; + /// The state key of the m.third_party_invite event. + QString token; + /// A signatures object containing a signature of the entire signed + /// object. + QJsonObject signatures; + }; + + /// A signature of an ``m.third_party_invite`` token to prove that this + /// user owns a third party identity which has been invited to the room. + struct ThirdPartySigned { + /// A signature of an ``m.third_party_invite`` token to prove that + /// this user owns a third party identity which has been invited to + /// the room. + Signed signedData; + }; + + // Construction/destruction + + /*! Start the requesting user participating in a particular room. + * \param roomIdOrAlias + * The room identifier or alias to join. + * \param serverName + * The servers to attempt to join the room through. One of the servers + * must be participating in the room. + * \param thirdPartySigned + * A signature of an ``m.third_party_invite`` token to prove that this + * user owns a third party identity which has been invited to the room. + */ + explicit JoinRoomJob( + const QString& roomIdOrAlias, + const QStringList& serverName = {}, + const Omittable& thirdPartySigned = none); + ~JoinRoomJob() override; + + // Result properties + + /// The joined room ID. + const QString& roomId() const; protected: - Status parseJson(const QJsonDocument& data) override; + Status parseJson(const QJsonDocument& data) override; private: - class Private; - QScopedPointer d; + class Private; + QScopedPointer d; }; } // namespace QMatrixClient -- cgit v1.2.3 From 27ca32a1e5a56e09b9cc1d94224d2831004dcf3d Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 7 Jul 2019 19:32:34 +0900 Subject: Namespace: QMatrixClient -> Quotient (with back comp alias) --- lib/csapi/joining.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/csapi/joining.h') diff --git a/lib/csapi/joining.h b/lib/csapi/joining.h index a96f323d..cf456da9 100644 --- a/lib/csapi/joining.h +++ b/lib/csapi/joining.h @@ -10,7 +10,7 @@ #include -namespace QMatrixClient +namespace Quotient { // Operations @@ -165,4 +165,4 @@ private: QScopedPointer d; }; -} // namespace QMatrixClient +} // namespace Quotient -- cgit v1.2.3 From 7036ed0dcb137cb5cbb6b426dd338c5e2e4c6424 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Fri, 17 Apr 2020 07:42:13 +0200 Subject: Regenerate API files using new GTAD and refreshed templates No functional changes. --- lib/csapi/joining.h | 54 ++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'lib/csapi/joining.h') diff --git a/lib/csapi/joining.h b/lib/csapi/joining.h index cf456da9..6d93bcb1 100644 --- a/lib/csapi/joining.h +++ b/lib/csapi/joining.h @@ -10,13 +10,12 @@ #include -namespace Quotient -{ +namespace Quotient { // Operations -/// Start the requesting user participating in a particular room. -/*! +/*! \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.* * @@ -32,15 +31,13 @@ namespace Quotient * 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 -{ +class JoinRoomByIdJob : public BaseJob { public: // Inner data structures /// A signature of an ``m.third_party_invite`` token to prove that this user /// owns a third party identity which has been invited to the room. - struct ThirdPartySigned - { + struct ThirdPartySigned { /// The Matrix ID of the user who issued the invite. QString sender; /// The Matrix ID of the invitee. @@ -54,7 +51,8 @@ public: // Construction/destruction - /*! Start the requesting user participating in a particular room. + /*! \brief Start the requesting user participating in a particular room. + * * \param roomId * The room identifier (not alias) to join. * \param thirdPartySigned @@ -80,8 +78,8 @@ private: QScopedPointer d; }; -/// Start the requesting user participating in a particular room. -/*! +/*! \brief Start the requesting user participating in a particular room. + * * *Note that this API takes either a room ID or alias, unlike* * ``/room/{roomId}/join``. * @@ -97,23 +95,25 @@ private: * 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 -{ +class JoinRoomJob : public BaseJob { public: // Inner data structures /// *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 useris allowed to participate in that room. - /// After this call, the client isallowed to see all current state events in - /// the room, and all subsequentevents 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 theresponse of the |/initialSync|_ and |/sync|_ - /// APIs.If a ``third_party_signed`` was supplied, the homeserver must - /// verifythat it matches a pending ``m.room.third_party_invite`` event in - /// theroom, and perform key validity checking if required by the event. - struct Signed - { + /// ``/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. + struct Signed { /// The Matrix ID of the user who issued the invite. QString sender; /// The Matrix ID of the invitee. @@ -127,8 +127,7 @@ public: /// A signature of an ``m.third_party_invite`` token to prove that this user /// owns a third party identity which has been invited to the room. - struct ThirdPartySigned - { + struct ThirdPartySigned { /// A signature of an ``m.third_party_invite`` token to prove that this /// user owns a third party identity which has been invited to the room. Signed signedData; @@ -136,7 +135,8 @@ public: // Construction/destruction - /*! Start the requesting user participating in a particular room. + /*! \brief Start the requesting user participating in a particular room. + * * \param roomIdOrAlias * The room identifier or alias to join. * \param serverName -- cgit v1.2.3 From 32729d9a7519cd2c4cddb0174b8329c6fd4a4a83 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 7 Jun 2020 19:46:40 +0200 Subject: Update generated files according to gtad/* changes --- lib/csapi/joining.h | 121 ++++++++++++++++------------------------------------ 1 file changed, 36 insertions(+), 85 deletions(-) (limited to 'lib/csapi/joining.h') diff --git a/lib/csapi/joining.h b/lib/csapi/joining.h index 6d93bcb1..6822fbdf 100644 --- a/lib/csapi/joining.h +++ b/lib/csapi/joining.h @@ -4,16 +4,12 @@ #pragma once -#include "converters.h" +#include "csapi/definitions/third_party_signed.h" #include "jobs/basejob.h" -#include - namespace Quotient { -// Operations - /*! \brief Start the requesting user participating in a particular room. * * *Note that this API requires a room ID, not alias.* ``/join/{roomIdOrAlias}`` @@ -33,49 +29,36 @@ namespace Quotient { */ class JoinRoomByIdJob : public BaseJob { public: - // Inner data structures - - /// A signature of an ``m.third_party_invite`` token to prove that this user - /// owns a third party identity which has been invited to the room. - struct ThirdPartySigned { - /// The Matrix ID of the user who issued the invite. - QString sender; - /// The Matrix ID of the invitee. - QString mxid; - /// The state key of the m.third_party_invite event. - QString token; - /// A signatures object containing a signature of the entire signed - /// object. - QJsonObject signatures; - }; - - // Construction/destruction - /*! \brief Start the requesting user participating in a particular room. + * * * \param roomId * The room identifier (not alias) to join. + * * \param thirdPartySigned - * A signature of an ``m.third_party_invite`` token to prove that this - * user owns a third party identity which has been invited to the room. + * *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. */ explicit JoinRoomByIdJob( const QString& roomId, const Omittable& thirdPartySigned = none); - ~JoinRoomByIdJob() override; - // Result properties /// The joined room ID. - const QString& roomId() const; - -protected: - Status parseJson(const QJsonDocument& data) override; - -private: - class Private; - QScopedPointer d; + QString roomId() const { return loadFromJson("room_id"_ls); } }; /*! \brief Start the requesting user participating in a particular room. @@ -97,72 +80,40 @@ private: */ class JoinRoomJob : public BaseJob { public: - // Inner data structures - - /// *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. - struct Signed { - /// The Matrix ID of the user who issued the invite. - QString sender; - /// The Matrix ID of the invitee. - QString mxid; - /// The state key of the m.third_party_invite event. - QString token; - /// A signatures object containing a signature of the entire signed - /// object. - QJsonObject signatures; - }; - - /// A signature of an ``m.third_party_invite`` token to prove that this user - /// owns a third party identity which has been invited to the room. - struct ThirdPartySigned { - /// A signature of an ``m.third_party_invite`` token to prove that this - /// user owns a third party identity which has been invited to the room. - Signed signedData; - }; - - // Construction/destruction - /*! \brief Start the requesting user participating in a particular room. + * * * \param roomIdOrAlias * The room identifier or alias to join. + * * \param serverName * The servers to attempt to join the room through. One of the servers * must be participating in the room. + * * \param thirdPartySigned - * A signature of an ``m.third_party_invite`` token to prove that this - * user owns a third party identity which has been invited to the room. + * *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. */ explicit JoinRoomJob( const QString& roomIdOrAlias, const QStringList& serverName = {}, const Omittable& thirdPartySigned = none); - ~JoinRoomJob() override; - // Result properties /// The joined room ID. - const QString& roomId() const; - -protected: - Status parseJson(const QJsonDocument& data) override; - -private: - class Private; - QScopedPointer d; + QString roomId() const { return loadFromJson("room_id"_ls); } }; } // namespace Quotient -- cgit v1.2.3 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/joining.h | 42 +++++------------------------------------- 1 file changed, 5 insertions(+), 37 deletions(-) (limited to 'lib/csapi/joining.h') 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. -- cgit v1.2.3