1#include "mtx/responses/messages.hpp"
2#include "mtx/responses/common.hpp"
3
4#include <nlohmann/json.hpp>
5
6using json = nlohmann::json;
7
8namespace mtx {
9namespace responses {
10
11void
12from_json(const json &obj, Messages &messages)
13{
14 messages.start = obj.value(key: "start", default_value: "");
15 messages.end = obj.value(key: "end", default_value: "");
16
17 if (obj.contains(key: "chunk"))
18 utils::parse_timeline_events(events: obj.at(key: "chunk"), container&: messages.chunk);
19}
20}
21}
22