diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-12-08 17:44:42 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-12-08 17:44:42 +0900 |
commit | 3489b77bba1b9429925dfe9539c2a9e8137fc622 (patch) | |
tree | 59a7cb3bc7b25eee12a37c43db4c069b7c240464 /lib/csapi/definitions | |
parent | 39204f0099e5556eb46bed00f3b31413af860a45 (diff) | |
parent | 5ea115d6eb0b60dfd0c2be5fbe5e69615b133238 (diff) | |
download | libquotient-3489b77bba1b9429925dfe9539c2a9e8137fc622.tar.gz libquotient-3489b77bba1b9429925dfe9539c2a9e8137fc622.zip |
Merge branch 'kitsune-tweaks-fixes'
Diffstat (limited to 'lib/csapi/definitions')
-rw-r--r-- | lib/csapi/definitions/room_event_filter.cpp | 6 | ||||
-rw-r--r-- | lib/csapi/definitions/room_event_filter.h | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/lib/csapi/definitions/room_event_filter.cpp b/lib/csapi/definitions/room_event_filter.cpp index f6f1e5cb..8cd2ded7 100644 --- a/lib/csapi/definitions/room_event_filter.cpp +++ b/lib/csapi/definitions/room_event_filter.cpp @@ -12,6 +12,8 @@ QJsonObject QMatrixClient::toJson(const RoomEventFilter& pod) addParam<IfNotEmpty>(jo, QStringLiteral("not_rooms"), pod.notRooms); addParam<IfNotEmpty>(jo, QStringLiteral("rooms"), pod.rooms); addParam<IfNotEmpty>(jo, QStringLiteral("contains_url"), pod.containsUrl); + addParam<IfNotEmpty>(jo, QStringLiteral("lazy_load_members"), pod.lazyLoadMembers); + addParam<IfNotEmpty>(jo, QStringLiteral("include_redundant_members"), pod.includeRedundantMembers); return jo; } @@ -24,6 +26,10 @@ RoomEventFilter FromJsonObject<RoomEventFilter>::operator()(const QJsonObject& j fromJson<QStringList>(jo.value("rooms"_ls)); result.containsUrl = fromJson<bool>(jo.value("contains_url"_ls)); + result.lazyLoadMembers = + fromJson<bool>(jo.value("lazy_load_members"_ls)); + result.includeRedundantMembers = + fromJson<bool>(jo.value("include_redundant_members"_ls)); return result; } diff --git a/lib/csapi/definitions/room_event_filter.h b/lib/csapi/definitions/room_event_filter.h index 697fe661..87f01189 100644 --- a/lib/csapi/definitions/room_event_filter.h +++ b/lib/csapi/definitions/room_event_filter.h @@ -21,6 +21,10 @@ namespace QMatrixClient QStringList rooms; /// If ``true``, includes only events with a ``url`` key in their content. If ``false``, excludes those events. Defaults to ``false``. bool containsUrl; + /// If ``true``, the only ``m.room.member`` events returned in the ``state`` section of the ``/sync`` response are those which are definitely necessary for a client to display the ``sender`` of the timeline events in that response. If ``false``, ``m.room.member`` events are not filtered. By default, servers should suppress duplicate redundant lazy-loaded ``m.room.member`` events from being sent to a given client across multiple calls to ``/sync``, given that most clients cache membership events (see include_redundant_members to change this behaviour). + bool lazyLoadMembers; + /// If ``true``, the ``state`` section of the ``/sync`` response will always contain the ``m.room.member`` events required to display the ``sender`` of the timeline events in that response, assuming ``lazy_load_members`` is enabled. This means that redundant duplicate member events may be returned across multiple calls to ``/sync``. This is useful for naive clients who never track membership data. If ``false``, duplicate ``m.room.member`` events may be suppressed by the server across multiple calls to ``/sync``. If ``lazy_load_members`` is ``false`` this field is ignored. + bool includeRedundantMembers; }; QJsonObject toJson(const RoomEventFilter& pod); |