Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 1aa6755

Browse files
committed
Deprecate on_threepid_bind
1 parent 49c839b commit 1aa6755

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

docs/modules/third_party_rules_callbacks.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,13 @@ If multiple modules implement this callback, Synapse runs them all in order.
251251

252252
_First introduced in Synapse v1.56.0_
253253

254+
**<span style="color:red">
255+
This callback is deprecated in favour of the `on_add_user_third_party_identifier` callback, which
256+
features nearly the same functionality. The only difference is that while `on_threepid_bind`
257+
was called *after* a third-party ID was associated with a user's account on the homeserver,
258+
`on_add_user_third_party_identifier` is called just *before* a third-party ID is associated.
259+
</span>**
260+
254261
```python
255262
async def on_threepid_bind(user_id: str, medium: str, address: str) -> None:
256263
```

docs/upgrade.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ in a future release.
9999
100100
## The `on_threepid_bind` module callback method has been deprecated
101101
102-
The [`on_threepid_bind`](modules/third_party_rules_callbacks.md#on_threepid_bind) "third-party rules"
102+
The [`on_threepid_bind`](modules/third_party_rules_callbacks.md#onthreepidbind) "third-party rules"
103103
Synapse module callback method has been deprecated
104104
in favour of a new module method,
105-
[`on_add_user_third_party_identifier`](modules/third_party_rules_callbacks.md#on_add_user_third_party_identifier).
105+
[`on_add_user_third_party_identifier`](modules/third_party_rules_callbacks.md#onadduserthirdpartyidentifier).
106106
`on_threepid_bind` will be removed in a future version of Synapse. You should check whether any Synapse
107107
modules in use in your deployment are making use of `on_threepid_bind`, and update them where possible.
108108
@@ -119,7 +119,7 @@ do so via an [identity server](https://spec.matrix.org/latest/identity-service-a
119119
it was only called when a user added a third-party identifier on the local homeserver.
120120

121121
Module developers may also be interested in the related
122-
[`on_remove_user_third_party_identifier`](modules/third_party_rules_callbacks.md#on_remove_user_third_party_identifier)
122+
[`on_remove_user_third_party_identifier`](modules/third_party_rules_callbacks.md#onremoveuserthirdpartyidentifier)
123123
module callback method that was also added in Synapse v1.77.0. This new method is called when a
124124
user removes a third-party identifier from their account.
125125

synapse/events/third_party_rules.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,9 @@ async def on_threepid_bind(self, user_id: str, medium: str, address: str) -> Non
530530
local homeserver, not when it's created on an identity server (and then kept track
531531
of so that it can be unbound on the same IS later on).
532532
533+
THIS MODULE CALLBACK METHOD HAS BEEN DEPRECATED. Please use the
534+
`on_add_user_third_party_identifier` callback method instead.
535+
533536
Args:
534537
user_id: the user being associated with the threepid.
535538
medium: the threepid's medium.

0 commit comments

Comments
 (0)