1 | #pragma once |
2 | |
3 | /// @file |
4 | /// @brief A bot generated message and other notices. |
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 | #include "mtx/events/common.hpp" |
15 | |
16 | namespace mtx { |
17 | namespace events { |
18 | namespace msg { |
19 | |
20 | //! Content of `m.room.message` with msgtype `m.notice`. |
21 | struct Notice |
22 | { |
23 | //! The notice text to send. |
24 | std::string body; |
25 | //! Must be 'm.notice'. |
26 | std::string msgtype; |
27 | //! We only handle org.matrix.custom.html. |
28 | std::string format; |
29 | //! HTML formatted message. |
30 | std::string formatted_body; |
31 | //! Relates to for rich replies |
32 | mtx::common::Relations relations; |
33 | |
34 | friend void from_json(const nlohmann::json &obj, Notice &content); |
35 | friend void to_json(nlohmann::json &obj, const Notice &content); |
36 | }; |
37 | |
38 | } // namespace msg |
39 | } // namespace events |
40 | } // namespace mtx |
41 | |