aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/definitions/public_rooms_response.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/csapi/definitions/public_rooms_response.h')
-rw-r--r--lib/csapi/definitions/public_rooms_response.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/csapi/definitions/public_rooms_response.h b/lib/csapi/definitions/public_rooms_response.h
index 8f30e607..2938b4ec 100644
--- a/lib/csapi/definitions/public_rooms_response.h
+++ b/lib/csapi/definitions/public_rooms_response.h
@@ -36,7 +36,13 @@ struct PublicRoomsChunk {
bool guestCanJoin;
/// The URL for the room's avatar, if one is set.
- QString avatarUrl;
+ QUrl avatarUrl;
+
+ /// The room's join rule. When not present, the room is assumed to
+ /// be `public`. Note that rooms with `invite` join rules are not
+ /// expected here, but rooms with `knock` rules are given their
+ /// near-public nature.
+ QString joinRule;
};
template <>
@@ -54,6 +60,7 @@ struct JsonObjectConverter<PublicRoomsChunk> {
addParam<>(jo, QStringLiteral("world_readable"), pod.worldReadable);
addParam<>(jo, QStringLiteral("guest_can_join"), pod.guestCanJoin);
addParam<IfNotEmpty>(jo, QStringLiteral("avatar_url"), pod.avatarUrl);
+ addParam<IfNotEmpty>(jo, QStringLiteral("join_rule"), pod.joinRule);
}
static void fillFrom(const QJsonObject& jo, PublicRoomsChunk& pod)
{
@@ -66,6 +73,7 @@ struct JsonObjectConverter<PublicRoomsChunk> {
fromJson(jo.value("world_readable"_ls), pod.worldReadable);
fromJson(jo.value("guest_can_join"_ls), pod.guestCanJoin);
fromJson(jo.value("avatar_url"_ls), pod.avatarUrl);
+ fromJson(jo.value("join_rule"_ls), pod.joinRule);
}
};