summary refs log tree commit diff
path: root/synapse/handlers/identity.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-04-01 10:21:12 +0100
committerErik Johnston <erik@matrix.org>2019-04-01 15:25:18 +0100
commit057715aaa2b143843692ebe5fd137fed6e5d671c (patch)
treeef0ea564f6081747bcc01a33c8e1a9821423db33 /synapse/handlers/identity.py
parentFor unbind poke IS used during binding of 3PID (diff)
downloadsynapse-057715aaa2b143843692ebe5fd137fed6e5d671c.tar.xz
Allowing specifying IS to use in unbind API.
By default the homeserver will use the identity server used during the
binding of the 3PID to unbind the 3PID. However, we need to allow
clients to explicitly ask the homeserver to unbind via a particular
identity server, for the case where the 3PID was bound out of band from
the homeserver.

Implements MSC915.
Diffstat (limited to 'synapse/handlers/identity.py')
-rw-r--r--synapse/handlers/identity.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/synapse/handlers/identity.py b/synapse/handlers/identity.py
index 765b16d1d9..4c127ba125 100644
--- a/synapse/handlers/identity.py
+++ b/synapse/handlers/identity.py
@@ -159,11 +159,14 @@ class IdentityHandler(BaseHandler):
             Deferred[bool]: True on success, otherwise False if the identity
             server doesn't support unbinding
         """
-        id_servers = yield self.store.get_id_servers_user_bound(
-            user_id=mxid,
-            medium=threepid["medium"],
-            address=threepid["address"],
-        )
+        if threepid.get("id_server"):
+            id_servers = [threepid["id_server"]]
+        else:
+            id_servers = yield self.store.get_id_servers_user_bound(
+                user_id=mxid,
+                medium=threepid["medium"],
+                address=threepid["address"],
+            )
 
         # We don't know where to unbind, so we don't have a choice but to return
         if not id_servers: