summary refs log tree commit diff
path: root/synapse/handlers/auth.py
diff options
context:
space:
mode:
authorNeil Johnson <neil@matrix.org>2018-08-15 16:27:08 +0100
committerNeil Johnson <neil@matrix.org>2018-08-15 16:27:08 +0100
commit86a00e05e1db0fd4fa7a0192520504c229b6f79c (patch)
tree17c0ac3804e223913549a50cfa6c5d5616824568 /synapse/handlers/auth.py
parentMerge branch 'develop' of github.com:matrix-org/synapse into neilj/fix_off_by... (diff)
parentMerge pull request #3653 from matrix-org/erikj/split_federation (diff)
downloadsynapse-86a00e05e1db0fd4fa7a0192520504c229b6f79c.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into neilj/fix_off_by_1+maus
Diffstat (limited to 'synapse/handlers/auth.py')
-rw-r--r--synapse/handlers/auth.py20
1 files changed, 17 insertions, 3 deletions
diff --git a/synapse/handlers/auth.py b/synapse/handlers/auth.py
index 7baaa39447..4a81bd2ba9 100644
--- a/synapse/handlers/auth.py
+++ b/synapse/handlers/auth.py
@@ -828,12 +828,26 @@ class AuthHandler(BaseHandler):
 
     @defer.inlineCallbacks
     def delete_threepid(self, user_id, medium, address):
+        """Attempts to unbind the 3pid on the identity servers and deletes it
+        from the local database.
+
+        Args:
+            user_id (str)
+            medium (str)
+            address (str)
+
+        Returns:
+            Deferred[bool]: Returns True if successfully unbound the 3pid on
+            the identity server, False if identity server doesn't support the
+            unbind API.
+        """
+
         # 'Canonicalise' email addresses as per above
         if medium == 'email':
             address = address.lower()
 
         identity_handler = self.hs.get_handlers().identity_handler
-        yield identity_handler.unbind_threepid(
+        result = yield identity_handler.try_unbind_threepid(
             user_id,
             {
                 'medium': medium,
@@ -841,10 +855,10 @@ class AuthHandler(BaseHandler):
             },
         )
 
-        ret = yield self.store.user_delete_threepid(
+        yield self.store.user_delete_threepid(
             user_id, medium, address,
         )
-        defer.returnValue(ret)
+        defer.returnValue(result)
 
     def _save_session(self, session):
         # TODO: Persistent storage