mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-05-31 23:04:18 -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
|
@ -68,11 +68,11 @@ class FollowerTypingHandler:
|
|||
)
|
||||
|
||||
# map room IDs to serial numbers
|
||||
self._room_serials = {} # type: Dict[str, int]
|
||||
self._room_serials: Dict[str, int] = {}
|
||||
# map room IDs to sets of users currently typing
|
||||
self._room_typing = {} # type: Dict[str, Set[str]]
|
||||
self._room_typing: Dict[str, Set[str]] = {}
|
||||
|
||||
self._member_last_federation_poke = {} # type: Dict[RoomMember, int]
|
||||
self._member_last_federation_poke: Dict[RoomMember, int] = {}
|
||||
self.wheel_timer = WheelTimer(bucket_size=5000)
|
||||
self._latest_room_serial = 0
|
||||
|
||||
|
@ -217,7 +217,7 @@ class TypingWriterHandler(FollowerTypingHandler):
|
|||
hs.get_distributor().observe("user_left_room", self.user_left_room)
|
||||
|
||||
# clock time we expect to stop
|
||||
self._member_typing_until = {} # type: Dict[RoomMember, int]
|
||||
self._member_typing_until: Dict[RoomMember, int] = {}
|
||||
|
||||
# caches which room_ids changed at which serials
|
||||
self._typing_stream_change_cache = StreamChangeCache(
|
||||
|
@ -405,9 +405,9 @@ class TypingWriterHandler(FollowerTypingHandler):
|
|||
if last_id == current_id:
|
||||
return [], current_id, False
|
||||
|
||||
changed_rooms = self._typing_stream_change_cache.get_all_entities_changed(
|
||||
last_id
|
||||
) # type: Optional[Iterable[str]]
|
||||
changed_rooms: Optional[
|
||||
Iterable[str]
|
||||
] = self._typing_stream_change_cache.get_all_entities_changed(last_id)
|
||||
|
||||
if changed_rooms is None:
|
||||
changed_rooms = self._room_serials
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue