From 021c056efc200f968bb1c4c4eb99273c25e8247b Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Mon, 4 Nov 2019 15:55:20 -0700 Subject: [PATCH 1/4] Add filter query param to /context This was missed as part of lazy-loading. Fixes https://github.com/matrix-org/matrix-doc/issues/2338 --- api/client-server/event_context.yaml | 11 +++++++++++ .../client_server/newsfragments/2344.clarification | 1 + 2 files changed, 12 insertions(+) create mode 100644 changelogs/client_server/newsfragments/2344.clarification diff --git a/api/client-server/event_context.yaml b/api/client-server/event_context.yaml index 3bea351c..e0c74cbf 100644 --- a/api/client-server/event_context.yaml +++ b/api/client-server/event_context.yaml @@ -59,6 +59,17 @@ paths: description: |- The maximum number of events to return. Default: 10. x-example: 3 + - in: query + name: filter + type: string + description: |- + The ID of a filter created using the filter API or a filter JSON + object encoded as a string. The server will detect whether it is + an ID or a JSON object by whether the first character is a ``"{"`` + open brace. + + See `Filtering <#filtering>`_ for more information. + x-example: "66696p746572" responses: 200: description: The events and state surrounding the requested event. diff --git a/changelogs/client_server/newsfragments/2344.clarification b/changelogs/client_server/newsfragments/2344.clarification new file mode 100644 index 00000000..8c92d31e --- /dev/null +++ b/changelogs/client_server/newsfragments/2344.clarification @@ -0,0 +1 @@ +Add missing information on how filters are meant to work with ``/context``. From e59bb20dc36b7620008407fa2d0f86f715ab9e48 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Tue, 5 Nov 2019 16:08:15 -0700 Subject: [PATCH 2/4] Try to clarify the filter information on /context --- api/client-server/event_context.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/api/client-server/event_context.yaml b/api/client-server/event_context.yaml index e0c74cbf..b1c9956c 100644 --- a/api/client-server/event_context.yaml +++ b/api/client-server/event_context.yaml @@ -63,10 +63,9 @@ paths: name: filter type: string description: |- - The ID of a filter created using the filter API or a filter JSON - object encoded as a string. The server will detect whether it is - an ID or a JSON object by whether the first character is a ``"{"`` - open brace. + A JSON ``RoomEventFilter`` to filter the returned events with. The + filter can be applied before or/and after the ``limit`` parameter - + whichever the homeserver prefers. See `Filtering <#filtering>`_ for more information. x-example: "66696p746572" From a1e5a96cf8eb00028f9ffb5b97f37c7e45d7fff6 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 6 Nov 2019 10:42:08 -0700 Subject: [PATCH 3/4] Update api/client-server/event_context.yaml Co-Authored-By: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> --- api/client-server/event_context.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/client-server/event_context.yaml b/api/client-server/event_context.yaml index b1c9956c..f76cbff1 100644 --- a/api/client-server/event_context.yaml +++ b/api/client-server/event_context.yaml @@ -64,7 +64,7 @@ paths: type: string description: |- A JSON ``RoomEventFilter`` to filter the returned events with. The - filter can be applied before or/and after the ``limit`` parameter - + filter may be applied before or/and after the ``limit`` parameter - whichever the homeserver prefers. See `Filtering <#filtering>`_ for more information. From 9f01850f7aa6fa6ec96f383716b1b0eff326e309 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 6 Nov 2019 10:43:11 -0700 Subject: [PATCH 4/4] Add some words about where the filter is applied --- api/client-server/event_context.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api/client-server/event_context.yaml b/api/client-server/event_context.yaml index f76cbff1..5fbfc198 100644 --- a/api/client-server/event_context.yaml +++ b/api/client-server/event_context.yaml @@ -64,8 +64,10 @@ paths: type: string description: |- A JSON ``RoomEventFilter`` to filter the returned events with. The - filter may be applied before or/and after the ``limit`` parameter - - whichever the homeserver prefers. + filter is only applied to ``events_before``, ``events_after``, and + ``state``. It is not applied to the ``event`` itself. The filter may + be applied before or/and after the ``limit`` parameter - whichever the + homeserver prefers. See `Filtering <#filtering>`_ for more information. x-example: "66696p746572"