summary refs log tree commit diff
path: root/synapse/rest/client/account.py
diff options
context:
space:
mode:
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: