| 1 | #include "mtx/events/unknown.hpp" |
|---|---|
| 2 | |
| 3 | #include <nlohmann/json.hpp> |
| 4 | |
| 5 | using json = nlohmann::json; |
| 6 | |
| 7 | namespace mtx { |
| 8 | namespace events { |
| 9 | |
| 10 | void |
| 11 | from_json(const json &obj, Unknown &event) |
| 12 | { |
| 13 | event.content = obj.dump(); |
| 14 | } |
| 15 | |
| 16 | void |
| 17 | to_json(json &obj, const Unknown &event) |
| 18 | { |
| 19 | try { |
| 20 | obj = json::parse(i: event.content); |
| 21 | } catch (...) { |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | } // namespace events |
| 26 | } // namespace mtx |
| 27 |