| 1 | #include <nlohmann/json.hpp> |
|---|---|
| 2 | #include <string> |
| 3 | |
| 4 | #include "mtx/events/reaction.hpp" |
| 5 | |
| 6 | using json = nlohmann::json; |
| 7 | |
| 8 | namespace mtx { |
| 9 | namespace events { |
| 10 | namespace msg { |
| 11 | |
| 12 | void |
| 13 | from_json(const json &obj, Reaction &content) |
| 14 | { |
| 15 | content.relations = common::parse_relations(obj); |
| 16 | } |
| 17 | |
| 18 | void |
| 19 | to_json(json &obj, const Reaction &content) |
| 20 | { |
| 21 | obj = nlohmann::json::object(); |
| 22 | |
| 23 | common::apply_relations(obj, relations: content.relations); |
| 24 | } |
| 25 | |
| 26 | } // namespace msg |
| 27 | } // namespace events |
| 28 | } // namespace mtx |
| 29 |