1 | #pragma once |
2 | |
3 | /// @file |
4 | /// @brief Events describing redactions and redacted content. |
5 | |
6 | #if __has_include(<nlohmann/json_fwd.hpp>) |
7 | #include <nlohmann/json_fwd.hpp> |
8 | #else |
9 | #include <nlohmann/json.hpp> |
10 | #endif |
11 | |
12 | #include <string> |
13 | |
14 | namespace mtx { |
15 | namespace events { |
16 | namespace msg { |
17 | |
18 | //! Content for the `m.room.redaction` state event. |
19 | struct Redaction |
20 | { |
21 | //! The reason for the redaction, if any. |
22 | std::string reason; |
23 | |
24 | friend void from_json(const nlohmann::json &obj, Redaction &event); |
25 | friend void to_json(nlohmann::json &obj, const Redaction &event); |
26 | }; |
27 | |
28 | //! Stripped out content for redacted events. |
29 | struct Redacted |
30 | { |
31 | friend inline void from_json(const nlohmann::json &, Redacted &) {} |
32 | friend inline void to_json(nlohmann::json &, const Redacted &) {} |
33 | }; |
34 | |
35 | } // namespace msg |
36 | } // namespace events |
37 | } // namespace mtx |
38 | |