5 #include <Quotient/csapi/definitions/event_filter.h>
7 #include <Quotient/converters.h>
14 std::optional<
bool> unreadThreadNotifications{};
19 std::optional<
bool> lazyLoadMembers{};
26 std::optional<
bool> includeRedundantMembers{};
30 QStringList notRooms{};
37 std::optional<
bool> containsUrl{};
41 struct JsonObjectConverter<RoomEventFilter> {
42 static void dumpTo(QJsonObject& jo,
const RoomEventFilter& pod)
44 fillJson<EventFilter>(jo, pod);
45 addParam<IfNotEmpty>(jo,
"unread_thread_notifications"_L1, pod.unreadThreadNotifications);
46 addParam<IfNotEmpty>(jo,
"lazy_load_members"_L1, pod.lazyLoadMembers);
47 addParam<IfNotEmpty>(jo,
"include_redundant_members"_L1, pod.includeRedundantMembers);
48 addParam<IfNotEmpty>(jo,
"not_rooms"_L1, pod.notRooms);
49 addParam<IfNotEmpty>(jo,
"rooms"_L1, pod.rooms);
50 addParam<IfNotEmpty>(jo,
"contains_url"_L1, pod.containsUrl);
52 static void fillFrom(
const QJsonObject& jo, RoomEventFilter& pod)
54 fillFromJson<EventFilter>(jo, pod);
55 fillFromJson(jo.value(
"unread_thread_notifications"_L1), pod.unreadThreadNotifications);
56 fillFromJson(jo.value(
"lazy_load_members"_L1), pod.lazyLoadMembers);
57 fillFromJson(jo.value(
"include_redundant_members"_L1), pod.includeRedundantMembers);
58 fillFromJson(jo.value(
"not_rooms"_L1), pod.notRooms);
59 fillFromJson(jo.value(
"rooms"_L1), pod.rooms);
60 fillFromJson(jo.value(
"contains_url"_L1), pod.containsUrl);