@@ -265,6 +265,44 @@ server_.
265
265
266
266
If multiple modules implement this callback, Synapse runs them all in order.
267
267
268
+ # ## `on_add_user_third_party_identifier`
269
+
270
+ _First introduced in Synapse v1.78.0_
271
+
272
+ ```python
273
+ async def on_add_user_third_party_identifier(user_id: str , medium: str , address: str ) -> None :
274
+ ```
275
+
276
+ Called just before creating an association between a user and a third- party identifier
277
+ (email address, phone number). The module is given the Matrix ID of the user the
278
+ association is for , as well as the medium (`email` or `msisdn` ) and address of the
279
+ third- party identifier (i.e. an email address).
280
+
281
+ Note that this callback is _not_ called if a user attempts to bind their third- party identifier
282
+ to an identity server (via a call to [`POST
283
+ / _matrix/ client/ v3/ account/ 3pid / bind`](https:// spec.matrix.org/ v1.5/ client- server- api/ # post_matrixclientv3account3pidbind)).
284
+
285
+ If multiple modules implement this callback, Synapse runs them all in order.
286
+
287
+ # ## `on_remove_user_third_party_identifier`
288
+
289
+ _First introduced in Synapse v1.78.0_
290
+
291
+ ```python
292
+ async def on_remove_user_third_party_identifier(user_id: str , medium: str , address: str ) -> None :
293
+ ```
294
+
295
+ Called just before removing an association between a user and a third- party identifier
296
+ (email address, phone number). The module is given the Matrix ID of the user the
297
+ association is for , as well as the medium (`email` or `msisdn` ) and address of the
298
+ third- party identifier (i.e. an email address).
299
+
300
+ Note that this callback is _not_ called if a user attempts to unbind their third- party
301
+ identifier from an identity server (via a call to [`POST
302
+ / _matrix/ client/ v3/ account/ 3pid / unbind`](https:// spec.matrix.org/ v1.5/ client- server- api/ # post_matrixclientv3account3pidunbind)).
303
+
304
+ If multiple modules implement this callback, Synapse runs them all in order.
305
+
268
306
# # Example
269
307
270
308
The example below is a module that implements the third- party rules callback
@@ -297,4 +335,4 @@ class EventCensorer:
297
335
)
298
336
event_dict[" content" ] = new_event_content
299
337
return event_dict
300
- ```
338
+ ```
0 commit comments