mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-01 09:54:20 -04:00
Add type hints to various handlers. (#9223)
With this change all handlers except the e2e_* ones have type hints enabled.
This commit is contained in:
parent
26837d5dbe
commit
1baab20352
14 changed files with 205 additions and 138 deletions
|
@ -145,10 +145,6 @@ class UserDirectoryHandler(StateDeltasHandler):
|
|||
if self.pos is None:
|
||||
self.pos = await self.store.get_user_directory_stream_pos()
|
||||
|
||||
# If still None then the initial background update hasn't happened yet
|
||||
if self.pos is None:
|
||||
return None
|
||||
|
||||
# Loop round handling deltas until we're up to date
|
||||
while True:
|
||||
with Measure(self.clock, "user_dir_delta"):
|
||||
|
@ -233,6 +229,11 @@ class UserDirectoryHandler(StateDeltasHandler):
|
|||
|
||||
if change: # The user joined
|
||||
event = await self.store.get_event(event_id, allow_none=True)
|
||||
# It isn't expected for this event to not exist, but we
|
||||
# don't want the entire background process to break.
|
||||
if event is None:
|
||||
continue
|
||||
|
||||
profile = ProfileInfo(
|
||||
avatar_url=event.content.get("avatar_url"),
|
||||
display_name=event.content.get("displayname"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue