diff options
author | Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> | 2023-02-27 14:19:19 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-27 14:19:19 +0000 |
commit | b40657314e03583f45ad49504711698a70735313 (patch) | |
tree | a292a2a0dac2c7c13769d97052624dc5d215928b /synapse/rest/client/account.py | |
parent | Refactor media modules. (#15146) (diff) | |
download | synapse-b40657314e03583f45ad49504711698a70735313.tar.xz |
Add module API callbacks for adding and deleting local 3PID associations (#15044
Diffstat (limited to 'synapse/rest/client/account.py')
-rw-r--r-- | synapse/rest/client/account.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/synapse/rest/client/account.py b/synapse/rest/client/account.py index 662f5bf762..484d7440a4 100644 --- a/synapse/rest/client/account.py +++ b/synapse/rest/client/account.py @@ -768,7 +768,9 @@ class ThreepidDeleteRestServlet(RestServlet): user_id = requester.user.to_string() try: - ret = await self.auth_handler.delete_threepid( + # Attempt to remove any known bindings of this third-party ID + # and user ID from identity servers. + ret = await self.hs.get_identity_handler().try_unbind_threepid( user_id, body.medium, body.address, body.id_server ) except Exception: @@ -783,6 +785,11 @@ class ThreepidDeleteRestServlet(RestServlet): else: id_server_unbind_result = "no-support" + # Delete the local association of this user ID and third-party ID. + await self.auth_handler.delete_local_threepid( + user_id, body.medium, body.address + ) + return 200, {"id_server_unbind_result": id_server_unbind_result} |