1 | #pragma once |
2 | |
3 | /// @file |
4 | /// @brief An event describing a room upgrade or shutdown. |
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 | namespace mtx { |
13 | namespace events { |
14 | namespace state { |
15 | |
16 | //! Content for the `m.room.tombstone` event. |
17 | // |
18 | //! A state event signifying that a room has been |
19 | //! upgraded to a different room version, and |
20 | //! that clients should go there. |
21 | struct Tombstone |
22 | { |
23 | //! Required. A server-defined message. |
24 | std::string body; |
25 | //! Required. The new room the client should be visiting. |
26 | std::string replacement_room; |
27 | |
28 | //! Deserialization method needed by @p nlohmann::json. |
29 | friend void from_json(const nlohmann::json &obj, Tombstone &content); |
30 | |
31 | //! Serialization method needed by @p nlohmann::json. |
32 | friend void to_json(nlohmann::json &obj, const Tombstone &content); |
33 | }; |
34 | |
35 | } // namespace state |
36 | } // namespace events |
37 | } // namespace mtx |
38 | |