mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-04 05:24: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
|
@ -192,7 +192,7 @@ class SearchHandler(BaseHandler):
|
|||
# If doing a subset of all rooms seearch, check if any of the rooms
|
||||
# are from an upgraded room, and search their contents as well
|
||||
if search_filter.rooms:
|
||||
historical_room_ids = [] # type: List[str]
|
||||
historical_room_ids: List[str] = []
|
||||
for room_id in search_filter.rooms:
|
||||
# Add any previous rooms to the search if they exist
|
||||
ids = await self.get_old_rooms_from_upgraded_room(room_id)
|
||||
|
@ -216,9 +216,9 @@ class SearchHandler(BaseHandler):
|
|||
rank_map = {} # event_id -> rank of event
|
||||
allowed_events = []
|
||||
# Holds result of grouping by room, if applicable
|
||||
room_groups = {} # type: Dict[str, JsonDict]
|
||||
room_groups: Dict[str, JsonDict] = {}
|
||||
# Holds result of grouping by sender, if applicable
|
||||
sender_group = {} # type: Dict[str, JsonDict]
|
||||
sender_group: Dict[str, JsonDict] = {}
|
||||
|
||||
# Holds the next_batch for the entire result set if one of those exists
|
||||
global_next_batch = None
|
||||
|
@ -262,7 +262,7 @@ class SearchHandler(BaseHandler):
|
|||
s["results"].append(e.event_id)
|
||||
|
||||
elif order_by == "recent":
|
||||
room_events = [] # type: List[EventBase]
|
||||
room_events: List[EventBase] = []
|
||||
i = 0
|
||||
|
||||
pagination_token = batch_token
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue