From 29fb6ead27bdf782fd736af7eca25320ccc92aa9 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Fri, 10 Feb 2023 17:26:04 +0000 Subject: wip --- synapse/rest/client/account.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'synapse/rest/client/account.py') 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: -- cgit 1.5.1