1 | #pragma once |
2 | |
3 | /// @file |
4 | /// @brief Room avatar events. |
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 "mtx/events/common.hpp" |
13 | |
14 | namespace mtx { |
15 | namespace events { |
16 | namespace state { |
17 | |
18 | //! Content of the `m.room.avatar` event. |
19 | // |
20 | //! A picture that is associated with the room. |
21 | //! This can be displayed alongside the room information. |
22 | struct Avatar |
23 | { |
24 | //! Metadata about the image referred to in @p url. |
25 | mtx::common::ImageInfo image_info; |
26 | //! The URL to the image. |
27 | std::string url; |
28 | |
29 | //! Deserialization method needed by @p nlohmann::json. |
30 | friend void from_json(const nlohmann::json &obj, Avatar &avatar); |
31 | |
32 | //! Serialization method needed by @p nlohmann::json. |
33 | friend void to_json(nlohmann::json &obj, const Avatar &avatar); |
34 | }; |
35 | |
36 | } // namespace state |
37 | } // namespace events |
38 | } // namespace mtx |
39 | |