File: redaction.h

package info (click to toggle)
libquotient 0.9.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,588 kB
  • sloc: xml: 39,103; cpp: 25,226; sh: 97; makefile: 10
file content (48 lines) | stat: -rw-r--r-- 1,698 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN

#pragma once

#include <Quotient/jobs/basejob.h>

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:
    //! \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"_L1); }
};

inline auto collectResponse(const RedactEventJob* job) { return job->eventId(); }

} // namespace Quotient