mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 10:56:06 -04:00
Track IS used to bind 3PIDs
This will then be used to know which IS to default to when unbinding the threepid.
This commit is contained in:
parent
215c15d049
commit
1666c0696a
3 changed files with 119 additions and 0 deletions
|
@ -132,6 +132,14 @@ class IdentityHandler(BaseHandler):
|
|||
}
|
||||
)
|
||||
logger.debug("bound threepid %r to %s", creds, mxid)
|
||||
|
||||
# Remember where we bound the threepid
|
||||
yield self.store.add_user_bound_threepid(
|
||||
user_id=mxid,
|
||||
medium=data["medium"],
|
||||
address=data["address"],
|
||||
id_server=id_server,
|
||||
)
|
||||
except CodeMessageException as e:
|
||||
data = json.loads(e.msg) # XXX WAT?
|
||||
defer.returnValue(data)
|
||||
|
@ -188,6 +196,13 @@ class IdentityHandler(BaseHandler):
|
|||
content,
|
||||
headers,
|
||||
)
|
||||
|
||||
yield self.store.remove_user_bound_threepid(
|
||||
user_id=mxid,
|
||||
medium=threepid["medium"],
|
||||
address=threepid["address"],
|
||||
id_server=id_server,
|
||||
)
|
||||
except HttpResponseException as e:
|
||||
if e.code in (400, 404, 501,):
|
||||
# The remote server probably doesn't support unbinding (yet)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue