aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/definitions
diff options
context:
space:
mode:
Diffstat (limited to 'lib/csapi/definitions')
-rw-r--r--lib/csapi/definitions/public_rooms_response.h6
-rw-r--r--lib/csapi/definitions/room_event_filter.h9
2 files changed, 15 insertions, 0 deletions
diff --git a/lib/csapi/definitions/public_rooms_response.h b/lib/csapi/definitions/public_rooms_response.h
index d0a2595c..7c7d9cc6 100644
--- a/lib/csapi/definitions/public_rooms_response.h
+++ b/lib/csapi/definitions/public_rooms_response.h
@@ -35,6 +35,10 @@ struct PublicRoomsChunk {
/// The URL for the room's avatar, if one is set.
QUrl avatarUrl;
+ /// The `type` of room (from
+ /// [`m.room.create`](/client-server-api/#mroomcreate)), if any.
+ QString roomType;
+
/// 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
@@ -56,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("room_type"), pod.roomType);
addParam<IfNotEmpty>(jo, QStringLiteral("join_rule"), pod.joinRule);
}
static void fillFrom(const QJsonObject& jo, PublicRoomsChunk& pod)
@@ -68,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("room_type"_ls), pod.roomType);
fromJson(jo.value("join_rule"_ls), pod.joinRule);
}
};
diff --git a/lib/csapi/definitions/room_event_filter.h b/lib/csapi/definitions/room_event_filter.h
index 91caf667..293e5492 100644
--- a/lib/csapi/definitions/room_event_filter.h
+++ b/lib/csapi/definitions/room_event_filter.h
@@ -11,6 +11,11 @@
namespace Quotient {
struct RoomEventFilter : EventFilter {
+ /// If `true`, enables per-[thread](/client-server-api/#threading)
+ /// notification counts. Only applies to the `/sync` endpoint. Defaults to
+ /// `false`.
+ Omittable<bool> unreadThreadNotifications;
+
/// If `true`, enables lazy-loading of membership events. See
/// [Lazy-loading room
/// members](/client-server-api/#lazy-loading-room-members) for more
@@ -44,6 +49,8 @@ struct JsonObjectConverter<RoomEventFilter> {
static void dumpTo(QJsonObject& jo, const RoomEventFilter& pod)
{
fillJson<EventFilter>(jo, pod);
+ addParam<IfNotEmpty>(jo, QStringLiteral("unread_thread_notifications"),
+ pod.unreadThreadNotifications);
addParam<IfNotEmpty>(jo, QStringLiteral("lazy_load_members"),
pod.lazyLoadMembers);
addParam<IfNotEmpty>(jo, QStringLiteral("include_redundant_members"),
@@ -56,6 +63,8 @@ struct JsonObjectConverter<RoomEventFilter> {
static void fillFrom(const QJsonObject& jo, RoomEventFilter& pod)
{
fillFromJson<EventFilter>(jo, pod);
+ fromJson(jo.value("unread_thread_notifications"_ls),
+ pod.unreadThreadNotifications);
fromJson(jo.value("lazy_load_members"_ls), pod.lazyLoadMembers);
fromJson(jo.value("include_redundant_members"_ls),
pod.includeRedundantMembers);