diff options
author | Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> | 2020-04-06 12:35:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-06 12:35:30 +0100 |
commit | b21000a44fa8b6f5d28a2089033f76767dff868b (patch) | |
tree | 9cf7a78f3d68ef0ba990d3638b28d571a49407d3 /synapse/handlers/room_list.py | |
parent | Move client command handling out of TCP protocol (#7185) (diff) | |
download | synapse-b21000a44fa8b6f5d28a2089033f76767dff868b.tar.xz |
Improve error responses when a remote server doesn't allow you to access its public rooms list (#6899)
Diffstat (limited to 'synapse/handlers/room_list.py')
-rw-r--r-- | synapse/handlers/room_list.py | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/synapse/handlers/room_list.py b/synapse/handlers/room_list.py index 0b7d3da680..59c9906b31 100644 --- a/synapse/handlers/room_list.py +++ b/synapse/handlers/room_list.py @@ -15,6 +15,7 @@ import logging from collections import namedtuple +from typing import Any, Dict, Optional from six import iteritems @@ -105,22 +106,22 @@ class RoomListHandler(BaseHandler): @defer.inlineCallbacks def _get_public_room_list( self, - limit=None, - since_token=None, - search_filter=None, - network_tuple=EMPTY_THIRD_PARTY_ID, - from_federation=False, - ): + limit: Optional[int] = None, + since_token: Optional[str] = None, + search_filter: Optional[Dict] = None, + network_tuple: ThirdPartyInstanceID = EMPTY_THIRD_PARTY_ID, + from_federation: bool = False, + ) -> Dict[str, Any]: """Generate a public room list. Args: - limit (int|None): Maximum amount of rooms to return. - since_token (str|None) - search_filter (dict|None): Dictionary to filter rooms by. - network_tuple (ThirdPartyInstanceID): Which public list to use. + limit: Maximum amount of rooms to return. + since_token: + search_filter: Dictionary to filter rooms by. + network_tuple: Which public list to use. This can be (None, None) to indicate the main list, or a particular appservice and network id to use an appservice specific one. Setting to None returns all public rooms across all lists. - from_federation (bool): Whether this request originated from a + from_federation: Whether this request originated from a federating server or a client. Used for room filtering. """ |