diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2021-08-18 09:22:07 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-18 09:22:07 -0400 |
commit | bec01c075829730cf467572e2fcf93e15372b0e9 (patch) | |
tree | f644f343dec9e9d3c71c266e1afd37dc2872a8b2 /synapse/storage/databases | |
parent | Display an error page during failure of fallback UIA. (#10561) (diff) | |
download | synapse-bec01c075829730cf467572e2fcf93e15372b0e9.tar.xz |
Convert room member storage tuples to attrs. (#10629)
Instead of using namedtuples. This helps with asserting type hints and code completion.
Diffstat (limited to 'synapse/storage/databases')
-rw-r--r-- | synapse/storage/databases/main/roommember.py | 8 | ||||
-rw-r--r-- | synapse/storage/databases/main/user_directory.py | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/synapse/storage/databases/main/roommember.py b/synapse/storage/databases/main/roommember.py index e8157ba3d4..c2f6b9d63d 100644 --- a/synapse/storage/databases/main/roommember.py +++ b/synapse/storage/databases/main/roommember.py @@ -307,7 +307,9 @@ class RoomMemberWorkerStore(EventsWorkerStore): ) @cached() - async def get_invited_rooms_for_local_user(self, user_id: str) -> RoomsForUser: + async def get_invited_rooms_for_local_user( + self, user_id: str + ) -> List[RoomsForUser]: """Get all the rooms the *local* user is invited to. Args: @@ -522,7 +524,9 @@ class RoomMemberWorkerStore(EventsWorkerStore): _get_users_server_still_shares_room_with_txn, ) - async def get_rooms_for_user(self, user_id: str, on_invalidate=None): + async def get_rooms_for_user( + self, user_id: str, on_invalidate=None + ) -> FrozenSet[str]: """Returns a set of room_ids the user is currently joined to. If a remote user only returns rooms this server is currently diff --git a/synapse/storage/databases/main/user_directory.py b/synapse/storage/databases/main/user_directory.py index 9d28d69ac7..65dde67ae9 100644 --- a/synapse/storage/databases/main/user_directory.py +++ b/synapse/storage/databases/main/user_directory.py @@ -365,7 +365,7 @@ class UserDirectoryBackgroundUpdateStore(StateDeltasStore): return False async def update_profile_in_user_dir( - self, user_id: str, display_name: str, avatar_url: str + self, user_id: str, display_name: Optional[str], avatar_url: Optional[str] ) -> None: """ Update or add a user's profile in the user directory. |