5 #include <Quotient/converters.h>
14 std::optional<
int> limit{};
18 QStringList notSenders{};
23 QStringList notTypes{};
26 QStringList senders{};
34 struct JsonObjectConverter<EventFilter> {
35 static void dumpTo(QJsonObject& jo,
const EventFilter& pod)
37 addParam<IfNotEmpty>(jo,
"limit"_L1, pod.limit);
38 addParam<IfNotEmpty>(jo,
"not_senders"_L1, pod.notSenders);
39 addParam<IfNotEmpty>(jo,
"not_types"_L1, pod.notTypes);
40 addParam<IfNotEmpty>(jo,
"senders"_L1, pod.senders);
41 addParam<IfNotEmpty>(jo,
"types"_L1, pod.types);
43 static void fillFrom(
const QJsonObject& jo, EventFilter& pod)
45 fillFromJson(jo.value(
"limit"_L1), pod.limit);
46 fillFromJson(jo.value(
"not_senders"_L1), pod.notSenders);
47 fillFromJson(jo.value(
"not_types"_L1), pod.notTypes);
48 fillFromJson(jo.value(
"senders"_L1), pod.senders);
49 fillFromJson(jo.value(
"types"_L1), pod.types);