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/room_state.h | 133 ++++++++++++++++++++++++++----------------------- 1 file changed, 71 insertions(+), 62 deletions(-) (limited to 'lib/csapi/room_state.h') diff --git a/lib/csapi/room_state.h b/lib/csapi/room_state.h index 67420545..07407af2 100644 --- a/lib/csapi/room_state.h +++ b/lib/csapi/room_state.h @@ -8,8 +8,7 @@ #include -namespace QMatrixClient -{ +namespace QMatrixClient { // Operations /// Send a state event to the given room. @@ -17,51 +16,55 @@ namespace QMatrixClient /// State events can be sent using this endpoint. These events will be /// overwritten if ````, ```` and ```` all /// match. - /// + /// /// Requests to this endpoint **cannot use transaction IDs** /// like other ``PUT`` paths because they cannot be differentiated from the /// ``state_key``. Furthermore, ``POST`` is unsupported on state paths. - /// + /// /// The body of the request should be the content object of the event; the /// fields in this object will vary depending on the type of event. See /// `Room Events`_ for the ``m.`` event specification. class SetRoomStateWithKeyJob : public BaseJob { public: - /*! Send a state event to the given room. - * \param roomId - * The room to set the state in - * \param eventType - * The type of event to send. - * \param stateKey - * The state_key for the state to send. Defaults to the empty string. - * \param body - * State events can be sent using this endpoint. These events will be - * overwritten if ````, ```` and ```` all - * match. - * - * Requests to this endpoint **cannot use transaction IDs** - * like other ``PUT`` paths because they cannot be differentiated from the - * ``state_key``. Furthermore, ``POST`` is unsupported on state paths. - * - * The body of the request should be the content object of the event; the - * fields in this object will vary depending on the type of event. See - * `Room Events`_ for the ``m.`` event specification. - */ - explicit SetRoomStateWithKeyJob(const QString& roomId, const QString& eventType, const QString& stateKey, const QJsonObject& body = {}); - ~SetRoomStateWithKeyJob() override; + /*! Send a state event to the given room. + * \param roomId + * The room to set the state in + * \param eventType + * The type of event to send. + * \param stateKey + * The state_key for the state to send. Defaults to the empty string. + * \param body + * State events can be sent using this endpoint. These events will be + * overwritten if ````, ```` and ```` + * all match. + * + * Requests to this endpoint **cannot use transaction IDs** + * like other ``PUT`` paths because they cannot be differentiated from + * the + * ``state_key``. Furthermore, ``POST`` is unsupported on state paths. + * + * The body of the request should be the content object of the event; + * the fields in this object will vary depending on the type of event. + * See `Room Events`_ for the ``m.`` event specification. + */ + explicit SetRoomStateWithKeyJob(const QString& roomId, + const QString& eventType, + const QString& stateKey, + const QJsonObject& body = {}); + ~SetRoomStateWithKeyJob() override; - // Result properties + // Result properties - /// A unique identifier for the event. - const QString& eventId() const; + /// A unique identifier for the event. + const QString& eventId() const; protected: - Status parseJson(const QJsonDocument& data) override; + Status parseJson(const QJsonDocument& data) override; private: - class Private; - QScopedPointer d; + class Private; + QScopedPointer d; }; /// Send a state event to the given room. @@ -69,50 +72,56 @@ namespace QMatrixClient /// State events can be sent using this endpoint. This endpoint is /// equivalent to calling `/rooms/{roomId}/state/{eventType}/{stateKey}` /// with an empty `stateKey`. Previous state events with matching - /// `` and ``, and empty ``, will be overwritten. - /// + /// `` and ``, and empty ``, will be + /// overwritten. + /// /// Requests to this endpoint **cannot use transaction IDs** /// like other ``PUT`` paths because they cannot be differentiated from the /// ``state_key``. Furthermore, ``POST`` is unsupported on state paths. - /// + /// /// The body of the request should be the content object of the event; the /// fields in this object will vary depending on the type of event. See /// `Room Events`_ for the ``m.`` event specification. class SetRoomStateJob : public BaseJob { public: - /*! Send a state event to the given room. - * \param roomId - * The room to set the state in - * \param eventType - * The type of event to send. - * \param body - * State events can be sent using this endpoint. This endpoint is - * equivalent to calling `/rooms/{roomId}/state/{eventType}/{stateKey}` - * with an empty `stateKey`. Previous state events with matching - * `` and ``, and empty ``, will be overwritten. - * - * Requests to this endpoint **cannot use transaction IDs** - * like other ``PUT`` paths because they cannot be differentiated from the - * ``state_key``. Furthermore, ``POST`` is unsupported on state paths. - * - * The body of the request should be the content object of the event; the - * fields in this object will vary depending on the type of event. See - * `Room Events`_ for the ``m.`` event specification. - */ - explicit SetRoomStateJob(const QString& roomId, const QString& eventType, const QJsonObject& body = {}); - ~SetRoomStateJob() override; + /*! Send a state event to the given room. + * \param roomId + * The room to set the state in + * \param eventType + * The type of event to send. + * \param body + * State events can be sent using this endpoint. This endpoint is + * equivalent to calling + * `/rooms/{roomId}/state/{eventType}/{stateKey}` with an empty + * `stateKey`. Previous state events with matching + * `` and ``, and empty ``, will be + * overwritten. + * + * Requests to this endpoint **cannot use transaction IDs** + * like other ``PUT`` paths because they cannot be differentiated from + * the + * ``state_key``. Furthermore, ``POST`` is unsupported on state paths. + * + * The body of the request should be the content object of the event; + * the fields in this object will vary depending on the type of event. + * See `Room Events`_ for the ``m.`` event specification. + */ + explicit SetRoomStateJob(const QString& roomId, + const QString& eventType, + const QJsonObject& body = {}); + ~SetRoomStateJob() override; - // Result properties + // Result properties - /// A unique identifier for the event. - const QString& eventId() const; + /// A unique identifier for the event. + const QString& eventId() 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/room_state.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/csapi/room_state.h') diff --git a/lib/csapi/room_state.h b/lib/csapi/room_state.h index 6ddd5594..80619d63 100644 --- a/lib/csapi/room_state.h +++ b/lib/csapi/room_state.h @@ -8,7 +8,7 @@ #include -namespace QMatrixClient +namespace Quotient { // Operations @@ -126,4 +126,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/room_state.h | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'lib/csapi/room_state.h') diff --git a/lib/csapi/room_state.h b/lib/csapi/room_state.h index 80619d63..7843cff4 100644 --- a/lib/csapi/room_state.h +++ b/lib/csapi/room_state.h @@ -8,13 +8,12 @@ #include -namespace Quotient -{ +namespace Quotient { // Operations -/// Send a state event to the given room. -/*! +/*! \brief Send a state event to the given room. + * * State events can be sent using this endpoint. These events will be * overwritten if ````, ```` and ```` all * match. @@ -27,10 +26,10 @@ namespace Quotient * fields in this object will vary depending on the type of event. See * `Room Events`_ for the ``m.`` event specification. */ -class SetRoomStateWithKeyJob : public BaseJob -{ +class SetRoomStateWithKeyJob : public BaseJob { public: - /*! Send a state event to the given room. + /*! \brief Send a state event to the given room. + * * \param roomId * The room to set the state in * \param eventType @@ -70,8 +69,8 @@ private: QScopedPointer d; }; -/// Send a state event to the given room. -/*! +/*! \brief Send a state event to the given room. + * * State events can be sent using this endpoint. This endpoint is * equivalent to calling `/rooms/{roomId}/state/{eventType}/{stateKey}` * with an empty `stateKey`. Previous state events with matching @@ -85,10 +84,10 @@ private: * fields in this object will vary depending on the type of event. See * `Room Events`_ for the ``m.`` event specification. */ -class SetRoomStateJob : public BaseJob -{ +class SetRoomStateJob : public BaseJob { public: - /*! Send a state event to the given room. + /*! \brief Send a state event to the given room. + * * \param roomId * The room to set the state in * \param eventType -- 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/room_state.h | 96 +++++++++++++------------------------------------- 1 file changed, 25 insertions(+), 71 deletions(-) (limited to 'lib/csapi/room_state.h') diff --git a/lib/csapi/room_state.h b/lib/csapi/room_state.h index 7843cff4..eeb2b33c 100644 --- a/lib/csapi/room_state.h +++ b/lib/csapi/room_state.h @@ -6,13 +6,12 @@ #include "jobs/basejob.h" -#include - namespace Quotient { -// Operations - /*! \brief Send a state event to the given room. + * + * .. For backwards compatibility with older links... + * .. _`put-matrix-client-r0-rooms-roomid-state-eventtype`: * * State events can be sent using this endpoint. These events will be * overwritten if ````, ```` and ```` all @@ -25,18 +24,32 @@ namespace Quotient { * The body of the request should be the content object of the event; the * fields in this object will vary depending on the type of event. See * `Room Events`_ for the ``m.`` event specification. + * + * If the event type being sent is ``m.room.canonical_alias`` servers + * SHOULD ensure that any new aliases being listed in the event are valid + * per their grammar/syntax and that they point to the room ID where the + * state event is to be sent. Servers do not validate aliases which are + * being removed or are already present in the state event. */ class SetRoomStateWithKeyJob : public BaseJob { public: /*! \brief Send a state event to the given room. + * * * \param roomId * The room to set the state in + * * \param eventType * The type of event to send. + * * \param stateKey - * The state_key for the state to send. Defaults to the empty string. + * The state_key for the state to send. Defaults to the empty string. When + * an empty string, the trailing slash on this endpoint is optional. + * * \param body + * .. For backwards compatibility with older links... + * .. _`put-matrix-client-r0-rooms-roomid-state-eventtype`: + * * State events can be sent using this endpoint. These events will be * overwritten if ````, ```` and ```` all * match. @@ -48,81 +61,22 @@ public: * The body of the request should be the content object of the event; the * fields in this object will vary depending on the type of event. See * `Room Events`_ for the ``m.`` event specification. + * + * If the event type being sent is ``m.room.canonical_alias`` servers + * SHOULD ensure that any new aliases being listed in the event are valid + * per their grammar/syntax and that they point to the room ID where the + * state event is to be sent. Servers do not validate aliases which are + * being removed or are already present in the state event. */ explicit SetRoomStateWithKeyJob(const QString& roomId, const QString& eventType, const QString& stateKey, const QJsonObject& body = {}); - ~SetRoomStateWithKeyJob() override; - - // Result properties - - /// A unique identifier for the event. - const QString& eventId() const; - -protected: - Status parseJson(const QJsonDocument& data) override; - -private: - class Private; - QScopedPointer d; -}; - -/*! \brief Send a state event to the given room. - * - * State events can be sent using this endpoint. This endpoint is - * equivalent to calling `/rooms/{roomId}/state/{eventType}/{stateKey}` - * with an empty `stateKey`. Previous state events with matching - * `` and ``, and empty ``, will be overwritten. - * - * Requests to this endpoint **cannot use transaction IDs** - * like other ``PUT`` paths because they cannot be differentiated from the - * ``state_key``. Furthermore, ``POST`` is unsupported on state paths. - * - * The body of the request should be the content object of the event; the - * fields in this object will vary depending on the type of event. See - * `Room Events`_ for the ``m.`` event specification. - */ -class SetRoomStateJob : public BaseJob { -public: - /*! \brief Send a state event to the given room. - * - * \param roomId - * The room to set the state in - * \param eventType - * The type of event to send. - * \param body - * State events can be sent using this endpoint. This endpoint is - * equivalent to calling `/rooms/{roomId}/state/{eventType}/{stateKey}` - * with an empty `stateKey`. Previous state events with matching - * `` and ``, and empty ``, will be - * overwritten. - * - * Requests to this endpoint **cannot use transaction IDs** - * like other ``PUT`` paths because they cannot be differentiated from the - * ``state_key``. Furthermore, ``POST`` is unsupported on state paths. - * - * The body of the request should be the content object of the event; the - * fields in this object will vary depending on the type of event. See - * `Room Events`_ for the ``m.`` event specification. - */ - explicit SetRoomStateJob(const QString& roomId, const QString& eventType, - const QJsonObject& body = {}); - - ~SetRoomStateJob() override; - // Result properties /// A unique identifier for the event. - const QString& eventId() const; - -protected: - Status parseJson(const QJsonDocument& data) override; - -private: - class Private; - QScopedPointer d; + QString eventId() const { return loadFromJson("event_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/room_state.h | 1 - 1 file changed, 1 deletion(-) (limited to 'lib/csapi/room_state.h') 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 -- cgit v1.2.3