mirror of
https://github.com/element-hq/synapse
synced 2024-08-31 12:50:21 +00:00
Merge pull request #5293 from Kagamihime/messages-federation-format
Fix ignored filter field in `/messages` endpoint
This commit is contained in:
commit
e9981d58ca
2 changed files with 3 additions and 0 deletions
1
changelog.d/5293.bugfix
Normal file
1
changelog.d/5293.bugfix
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Fix a bug where it is not possible to get events in the federation format with the request `GET /_matrix/client/r0/rooms/{roomId}/messages`.
|
|
@ -475,6 +475,8 @@ class RoomMessageListRestServlet(ClientV1RestServlet):
|
||||||
if filter_bytes:
|
if filter_bytes:
|
||||||
filter_json = urlparse.unquote(filter_bytes.decode("UTF-8"))
|
filter_json = urlparse.unquote(filter_bytes.decode("UTF-8"))
|
||||||
event_filter = Filter(json.loads(filter_json))
|
event_filter = Filter(json.loads(filter_json))
|
||||||
|
if event_filter.filter_json.get("event_format", "client") == "federation":
|
||||||
|
as_client_event = False
|
||||||
else:
|
else:
|
||||||
event_filter = None
|
event_filter = None
|
||||||
msgs = yield self.pagination_handler.get_messages(
|
msgs = yield self.pagination_handler.get_messages(
|
||||||
|
|
Loading…
Reference in a new issue