Skip to content

Commit 451a9dc

Browse files
Clarify when 3PID invite module callbacks are called (#17627)
Co-authored-by: Eric Eastwood <eric.eastwood@beta.gouv.fr>
1 parent f6a3e5e commit 451a9dc

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

changelog.d/17627.doc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Clarify when the `user_may_invite` and `user_may_send_3pid_invite` module callbacks are called.

docs/modules/spam_checker_callbacks.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ _Changed in Synapse v1.62.0: `synapse.module_api.NOT_SPAM` and `synapse.module_a
7676
async def user_may_invite(inviter: str, invitee: str, room_id: str) -> Union["synapse.module_api.NOT_SPAM", "synapse.module_api.errors.Codes", bool]
7777
```
7878

79-
Called when processing an invitation. Both inviter and invitee are
80-
represented by their Matrix user ID (e.g. `@alice:example.com`).
79+
Called when processing an invitation, both when one is created locally or when
80+
receiving an invite over federation. Both inviter and invitee are represented by
81+
their Matrix user ID (e.g. `@alice:example.com`).
8182

8283

8384
The callback must return one of:
@@ -112,7 +113,9 @@ async def user_may_send_3pid_invite(
112113
```
113114

114115
Called when processing an invitation using a third-party identifier (also called a 3PID,
115-
e.g. an email address or a phone number).
116+
e.g. an email address or a phone number). It is only called when a 3PID invite is created
117+
locally - not when one is received in a room over federation. If the 3PID is already associated
118+
with a Matrix ID, the spam check will go through the `user_may_invite` callback instead.
116119

117120
The inviter is represented by their Matrix user ID (e.g. `@alice:example.com`), and the
118121
invitee is represented by its medium (e.g. "email") and its address

0 commit comments

Comments
 (0)