diff options
author | Alexander Fechler <141915399+afechler@users.noreply.github.com> | 2024-06-19 12:45:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-19 11:45:48 +0100 |
commit | 9104a9f0d05fef9718ae4611b164b6dd1d85243c (patch) | |
tree | 8d95b96c78fa7e2e55dea2c77eb2153f5b6aaf24 /synapse/rest/admin | |
parent | Update the README with Element branding and a few fixes (#17324) (diff) | |
download | synapse-9104a9f0d05fef9718ae4611b164b6dd1d85243c.tar.xz |
Filter added to Admin-API GET /rooms (#17276)
Diffstat (limited to 'synapse/rest/admin')
-rw-r--r-- | synapse/rest/admin/rooms.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/synapse/rest/admin/rooms.py b/synapse/rest/admin/rooms.py index 0d86a4e15f..01f9de9ffa 100644 --- a/synapse/rest/admin/rooms.py +++ b/synapse/rest/admin/rooms.py @@ -35,6 +35,7 @@ from synapse.http.servlet import ( ResolveRoomIdMixin, RestServlet, assert_params_in_dict, + parse_boolean, parse_enum, parse_integer, parse_json, @@ -242,13 +243,23 @@ class ListRoomRestServlet(RestServlet): errcode=Codes.INVALID_PARAM, ) + public_rooms = parse_boolean(request, "public_rooms") + empty_rooms = parse_boolean(request, "empty_rooms") + direction = parse_enum(request, "dir", Direction, default=Direction.FORWARDS) reverse_order = True if direction == Direction.BACKWARDS else False # Return list of rooms according to parameters rooms, total_rooms = await self.store.get_rooms_paginate( - start, limit, order_by, reverse_order, search_term + start, + limit, + order_by, + reverse_order, + search_term, + public_rooms, + empty_rooms, ) + response = { # next_token should be opaque, so return a value the client can parse "offset": start, |