mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-06 12:54:55 -04:00
Use inline type hints in handlers/
and rest/
. (#10382)
This commit is contained in:
parent
36dc15412d
commit
98aec1cc9d
43 changed files with 212 additions and 215 deletions
|
@ -47,12 +47,12 @@ class RoomListHandler(BaseHandler):
|
|||
def __init__(self, hs: "HomeServer"):
|
||||
super().__init__(hs)
|
||||
self.enable_room_list_search = hs.config.enable_room_list_search
|
||||
self.response_cache = ResponseCache(
|
||||
hs.get_clock(), "room_list"
|
||||
) # type: ResponseCache[Tuple[Optional[int], Optional[str], Optional[ThirdPartyInstanceID]]]
|
||||
self.remote_response_cache = ResponseCache(
|
||||
hs.get_clock(), "remote_room_list", timeout_ms=30 * 1000
|
||||
) # type: ResponseCache[Tuple[str, Optional[int], Optional[str], bool, Optional[str]]]
|
||||
self.response_cache: ResponseCache[
|
||||
Tuple[Optional[int], Optional[str], Optional[ThirdPartyInstanceID]]
|
||||
] = ResponseCache(hs.get_clock(), "room_list")
|
||||
self.remote_response_cache: ResponseCache[
|
||||
Tuple[str, Optional[int], Optional[str], bool, Optional[str]]
|
||||
] = ResponseCache(hs.get_clock(), "remote_room_list", timeout_ms=30 * 1000)
|
||||
|
||||
async def get_local_public_room_list(
|
||||
self,
|
||||
|
@ -139,10 +139,10 @@ class RoomListHandler(BaseHandler):
|
|||
if since_token:
|
||||
batch_token = RoomListNextBatch.from_token(since_token)
|
||||
|
||||
bounds = (
|
||||
bounds: Optional[Tuple[int, str]] = (
|
||||
batch_token.last_joined_members,
|
||||
batch_token.last_room_id,
|
||||
) # type: Optional[Tuple[int, str]]
|
||||
)
|
||||
forwards = batch_token.direction_is_forward
|
||||
has_batch_token = True
|
||||
else:
|
||||
|
@ -182,7 +182,7 @@ class RoomListHandler(BaseHandler):
|
|||
|
||||
results = [build_room_entry(r) for r in results]
|
||||
|
||||
response = {} # type: JsonDict
|
||||
response: JsonDict = {}
|
||||
num_results = len(results)
|
||||
if limit is not None:
|
||||
more_to_come = num_results == probing_limit
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue