diff options
author | Richard van der Hoff <richard@matrix.org> | 2021-02-01 17:28:37 +0000 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2021-02-01 17:28:37 +0000 |
commit | 18ab35284a2270efe01815911885e45b0f743453 (patch) | |
tree | a0b6c0322233525e91b84e2b4c08800cfa9d7c18 /synapse/storage | |
parent | Add phone home stats for encrypted messages. (#9283) (diff) | |
parent | Replace username picker with a template (#9275) (diff) | |
download | synapse-18ab35284a2270efe01815911885e45b0f743453.tar.xz |
Merge branch 'social_login' into develop
Diffstat (limited to 'synapse/storage')
-rw-r--r-- | synapse/storage/databases/main/registration.py | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/synapse/storage/databases/main/registration.py b/synapse/storage/databases/main/registration.py index 0618b4387a..8405dd460f 100644 --- a/synapse/storage/databases/main/registration.py +++ b/synapse/storage/databases/main/registration.py @@ -472,6 +472,26 @@ class RegistrationWorkerStore(CacheInvalidationWorkerStore): return await self.db_pool.runInteraction("get_users_by_id_case_insensitive", f) + async def record_user_external_id( + self, auth_provider: str, external_id: str, user_id: str + ) -> None: + """Record a mapping from an external user id to a mxid + + Args: + auth_provider: identifier for the remote auth provider + external_id: id on that system + user_id: complete mxid that it is mapped to + """ + await self.db_pool.simple_insert( + table="user_external_ids", + values={ + "auth_provider": auth_provider, + "external_id": external_id, + "user_id": user_id, + }, + desc="record_user_external_id", + ) + async def get_user_by_external_id( self, auth_provider: str, external_id: str ) -> Optional[str]: @@ -1400,26 +1420,6 @@ class RegistrationStore(StatsStore, RegistrationBackgroundUpdateStore): self._invalidate_cache_and_stream(txn, self.get_user_by_id, (user_id,)) - async def record_user_external_id( - self, auth_provider: str, external_id: str, user_id: str - ) -> None: - """Record a mapping from an external user id to a mxid - - Args: - auth_provider: identifier for the remote auth provider - external_id: id on that system - user_id: complete mxid that it is mapped to - """ - await self.db_pool.simple_insert( - table="user_external_ids", - values={ - "auth_provider": auth_provider, - "external_id": external_id, - "user_id": user_id, - }, - desc="record_user_external_id", - ) - async def user_set_password_hash( self, user_id: str, password_hash: Optional[str] ) -> None: |