summary refs log tree commit diff
path: root/synapse/rest/client/account.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2023-02-10 17:26:04 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2023-02-10 17:26:04 +0000
commit29fb6ead27bdf782fd736af7eca25320ccc92aa9 (patch)
tree6a86c85eee5e23a2827561e6bba12b87bf9ae3b1 /synapse/rest/client/account.py
parentRename delete_threepid -> delete_and_unbind_threepid (diff)
downloadsynapse-anoa/blablabla.tar.xz
Diffstat (limited to 'synapse/rest/client/account.py')
-rw-r--r--synapse/rest/client/account.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/synapse/rest/client/account.py b/synapse/rest/client/account.py

index 5b1e94c746..e7c6ea335c 100644 --- a/synapse/rest/client/account.py +++ b/synapse/rest/client/account.py
@@ -770,8 +770,13 @@ class ThreepidDeleteRestServlet(RestServlet): user_id = requester.user.to_string() try: - ret = await self.auth_handler.delete_and_unbind_threepid( - user_id, body.medium, body.address, body.id_server + ret = await self.hs.get_identity_handler().try_unbind_threepid( + user_id, + { + "medium": body.medium, + "address": body.address, + "id_server": body.id_server, + }, ) except Exception: # NB. This endpoint should succeed if there is nothing to @@ -780,6 +785,11 @@ class ThreepidDeleteRestServlet(RestServlet): logger.exception("Failed to remove threepid") raise SynapseError(500, "Failed to remove threepid") + # Remove the local threepid association + await self.auth_handler.delete_local_threepid( + user_id, body.medium, body.address + ) + if ret: id_server_unbind_result = "success" else: