summary refs log tree commit diff
path: root/synapse/rest
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/rest')
-rw-r--r--synapse/rest/admin/users.py9
-rw-r--r--synapse/rest/client/account.py14
2 files changed, 19 insertions, 4 deletions
diff --git a/synapse/rest/admin/users.py b/synapse/rest/admin/users.py

index 9276a81d9f..9e33012ae3 100644 --- a/synapse/rest/admin/users.py +++ b/synapse/rest/admin/users.py
@@ -304,8 +304,13 @@ class UserRestServletV2(RestServlet): # remove old threepids for medium, address in del_threepids: try: - await self.auth_handler.delete_and_unbind_threepid( - user_id, medium, address, None + await self.hs.get_identity_handler().try_unbind_threepid( + user_id, + {"medium": medium, "address": address, "id_server": None}, + ) + + await self.auth_handler.delete_local_threepid( + user_id, medium, address ) except Exception: logger.exception("Failed to remove threepids") 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: