5 #include <Quotient/converters.h>
25 QString canonicalAlias{};
47 struct JsonObjectConverter<PublicRoomsChunk> {
48 static void dumpTo(QJsonObject& jo,
const PublicRoomsChunk& pod)
50 addParam<>(jo,
"num_joined_members"_L1, pod.numJoinedMembers);
51 addParam<>(jo,
"room_id"_L1, pod.roomId);
52 addParam<>(jo,
"world_readable"_L1, pod.worldReadable);
53 addParam<>(jo,
"guest_can_join"_L1, pod.guestCanJoin);
54 addParam<IfNotEmpty>(jo,
"canonical_alias"_L1, pod.canonicalAlias);
55 addParam<IfNotEmpty>(jo,
"name"_L1, pod.name);
56 addParam<IfNotEmpty>(jo,
"topic"_L1, pod.topic);
57 addParam<IfNotEmpty>(jo,
"avatar_url"_L1, pod.avatarUrl);
58 addParam<IfNotEmpty>(jo,
"join_rule"_L1, pod.joinRule);
59 addParam<IfNotEmpty>(jo,
"room_type"_L1, pod.roomType);
61 static void fillFrom(
const QJsonObject& jo, PublicRoomsChunk& pod)
63 fillFromJson(jo.value(
"num_joined_members"_L1), pod.numJoinedMembers);
64 fillFromJson(jo.value(
"room_id"_L1), pod.roomId);
65 fillFromJson(jo.value(
"world_readable"_L1), pod.worldReadable);
66 fillFromJson(jo.value(
"guest_can_join"_L1), pod.guestCanJoin);
67 fillFromJson(jo.value(
"canonical_alias"_L1), pod.canonicalAlias);
68 fillFromJson(jo.value(
"name"_L1), pod.name);
69 fillFromJson(jo.value(
"topic"_L1), pod.topic);
70 fillFromJson(jo.value(
"avatar_url"_L1), pod.avatarUrl);
71 fillFromJson(jo.value(
"join_rule"_L1), pod.joinRule);
72 fillFromJson(jo.value(
"room_type"_L1), pod.roomType);