| 1 | #pragma once |
| 2 | |
| 3 | /// @file |
| 4 | /// @brief Real-world locations to send in a room. |
| 5 | |
| 6 | #include <string> |
| 7 | |
| 8 | #if __has_include(<nlohmann/json_fwd.hpp>) |
| 9 | #include <nlohmann/json_fwd.hpp> |
| 10 | #else |
| 11 | #include <nlohmann/json.hpp> |
| 12 | #endif |
| 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.image`. |
| 21 | struct Location |
| 22 | { |
| 23 | //! Required. A description of the location e.g. 'Big Ben, London, UK', or some kind of |
| 24 | //! content description for accessibility e.g. 'location attachment'. |
| 25 | std::string body; |
| 26 | // Must be 'm.location'. |
| 27 | std::string msgtype; |
| 28 | //! Required. A geo URI representing this location. |
| 29 | std::string geo_uri; |
| 30 | //! A thumbnail for this location. |
| 31 | mtx::common::LocationInfo info; |
| 32 | //! Relates to for rich replies |
| 33 | mtx::common::Relations relations; |
| 34 | |
| 35 | //! Mentioned users by this event |
| 36 | std::optional<mtx::common::Mentions> mentions; |
| 37 | |
| 38 | friend void from_json(const nlohmann::json &obj, Location &content); |
| 39 | friend void to_json(nlohmann::json &obj, const Location &content); |
| 40 | }; |
| 41 | |
| 42 | } // namespace msg |
| 43 | } // namespace events |
| 44 | } // namespace mtx |