1 | #pragma once |
2 | |
3 | /// @file |
4 | /// @brief A video sent in a room. |
5 | |
6 | #include <optional> |
7 | #include <string> |
8 | |
9 | #if __has_include(<nlohmann/json_fwd.hpp>) |
10 | #include <nlohmann/json_fwd.hpp> |
11 | #else |
12 | #include <nlohmann/json.hpp> |
13 | #endif |
14 | |
15 | #include "mtx/common.hpp" |
16 | #include "mtx/events/common.hpp" |
17 | |
18 | namespace mtx { |
19 | namespace events { |
20 | namespace msg { |
21 | |
22 | //! Content of `m.room.message` with msgtype `m.video`. |
23 | struct Video |
24 | { |
25 | /// @brief A description of the video or some kind of content description |
26 | /// for accessibility. |
27 | std::string body; |
28 | //! Must be 'm.video'. |
29 | std::string msgtype; |
30 | //! The matrix URL of the video clip. |
31 | std::string url; |
32 | //! Metadata for the video clip referred to in url. |
33 | mtx::common::VideoInfo info; |
34 | //! Encryption members. If present, they replace url. |
35 | std::optional<crypto::EncryptedFile> file; |
36 | //! Relates to for rich replies |
37 | mtx::common::Relations relations; |
38 | |
39 | friend void from_json(const nlohmann::json &obj, Video &content); |
40 | friend void to_json(nlohmann::json &obj, const Video &content); |
41 | }; |
42 | |
43 | } // namespace msg |
44 | } // namespace events |
45 | } // namespace mtx |
46 | |