mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 21:34:51 -04:00
make /context lazyload & filter aware (#3567)
make /context lazyload & filter aware.
This commit is contained in:
parent
b0b5566f36
commit
e9b2d047f6
5 changed files with 43 additions and 7 deletions
|
@ -531,11 +531,20 @@ class RoomEventContextServlet(ClientV1RestServlet):
|
|||
|
||||
limit = parse_integer(request, "limit", default=10)
|
||||
|
||||
# picking the API shape for symmetry with /messages
|
||||
filter_bytes = parse_string(request, "filter")
|
||||
if filter_bytes:
|
||||
filter_json = urlparse.unquote(filter_bytes).decode("UTF-8")
|
||||
event_filter = Filter(json.loads(filter_json))
|
||||
else:
|
||||
event_filter = None
|
||||
|
||||
results = yield self.room_context_handler.get_event_context(
|
||||
requester.user,
|
||||
room_id,
|
||||
event_id,
|
||||
limit,
|
||||
event_filter,
|
||||
)
|
||||
|
||||
if not results:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue