diff options
author | n-peugnet <n.peugnet@free.fr> | 2022-10-06 19:27:24 +0200 |
---|---|---|
committer | n-peugnet <n.peugnet@free.fr> | 2022-10-06 19:27:24 +0200 |
commit | d911b207f49e936b3e992200796110f0749ed150 (patch) | |
tree | 96d20ebb4d074a4c1755e21cb316a52d584daee3 /lib/csapi/redaction.h | |
parent | 8ad8a74152c5701b6ca1f9a00487ba9257a439b4 (diff) | |
parent | 56c2f2e2b809b9077393eb617828f33d144f5634 (diff) | |
download | libquotient-d911b207f49e936b3e992200796110f0749ed150.tar.gz libquotient-d911b207f49e936b3e992200796110f0749ed150.zip |
New upstream version 0.7.0
Diffstat (limited to 'lib/csapi/redaction.h')
-rw-r--r-- | lib/csapi/redaction.h | 89 |
1 files changed, 44 insertions, 45 deletions
diff --git a/lib/csapi/redaction.h b/lib/csapi/redaction.h index d02abfd0..2f85793e 100644 --- a/lib/csapi/redaction.h +++ b/lib/csapi/redaction.h @@ -6,48 +6,47 @@ #include "jobs/basejob.h" - -namespace QMatrixClient -{ - // Operations - - /// Strips all non-integrity-critical information out of an event. - /// - /// Strips all information out of an event which isn't critical to the - /// integrity of the server-side representation of the room. - /// - /// This cannot be undone. - /// - /// Users may redact their own events, and any user with a power level - /// greater than or equal to the `redact` power level of the room may - /// redact events there. - class RedactEventJob : public BaseJob - { - public: - /*! Strips all non-integrity-critical information out of an event. - * \param roomId - * The room from which to redact the event. - * \param eventId - * The ID of the event to redact - * \param txnId - * The transaction ID for this event. Clients should generate a - * unique ID; it will be used by the server to ensure idempotency of requests. - * \param reason - * The reason for the event being redacted. - */ - explicit RedactEventJob(const QString& roomId, const QString& eventId, const QString& txnId, const QString& reason = {}); - ~RedactEventJob() override; - - // Result properties - - /// A unique identifier for the event. - const QString& eventId() const; - - protected: - Status parseJson(const QJsonDocument& data) override; - - private: - class Private; - QScopedPointer<Private> d; - }; -} // namespace QMatrixClient +namespace Quotient { + +/*! \brief Strips all non-integrity-critical information out of an event. + * + * Strips all information out of an event which isn't critical to the + * integrity of the server-side representation of the room. + * + * This cannot be undone. + * + * Any user with a power level greater than or equal to the `m.room.redaction` + * event power level may send redaction events in the room. If the user's power + * level greater is also greater than or equal to the `redact` power level + * of the room, the user may redact events sent by other users. + * + * Server administrators may redact events sent by users on their server. + */ +class QUOTIENT_API 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. + * + * \param eventId + * The ID of the event to redact + * + * \param txnId + * The [transaction ID](/client-server-api/#transaction-identifiers) for + * this event. Clients should generate a unique ID; it will be used by the + * server to ensure idempotency of requests. + * + * \param reason + * The reason for the event being redacted. + */ + explicit RedactEventJob(const QString& roomId, const QString& eventId, + const QString& txnId, const QString& reason = {}); + + // Result properties + + /// A unique identifier for the event. + QString eventId() const { return loadFromJson<QString>("event_id"_ls); } +}; + +} // namespace Quotient |