summary refs log tree commit diff
path: root/develop/modules
diff options
context:
space:
mode:
authorbabolivier <babolivier@users.noreply.github.com>2021-10-06 15:18:37 +0000
committerbabolivier <babolivier@users.noreply.github.com>2021-10-06 15:18:37 +0000
commit1c2a1a1355ad5d788dff0bb632b189dc217e2b2b (patch)
tree700456aefe5f6025becf242323d1f21e2a9bfacd /develop/modules
parentdeploy: 829f2a82b042d944fef3df55faec924502cdf20d (diff)
downloadsynapse-1c2a1a1355ad5d788dff0bb632b189dc217e2b2b.tar.xz
deploy: 4e5162106436f3fddd12561d316d19fd23148800
Diffstat (limited to 'develop/modules')
-rw-r--r--develop/modules/spam_checker_callbacks.html26
1 files changed, 26 insertions, 0 deletions
diff --git a/develop/modules/spam_checker_callbacks.html b/develop/modules/spam_checker_callbacks.html
index 7ec822f1e0..a7bc547907 100644
--- a/develop/modules/spam_checker_callbacks.html
+++ b/develop/modules/spam_checker_callbacks.html
@@ -211,6 +211,32 @@ context of a room creation.</p>
 <p>Called when processing an invitation. The module must return a <code>bool</code> indicating whether
 the inviter can invite the invitee to the given room. Both inviter and invitee are
 represented by their Matrix user ID (e.g. <code>@alice:example.com</code>).</p>
+<h3 id="user_may_send_3pid_invite"><a class="header" href="#user_may_send_3pid_invite"><code>user_may_send_3pid_invite</code></a></h3>
+<pre><code class="language-python">async def user_may_send_3pid_invite(
+    inviter: str,
+    medium: str,
+    address: str,
+    room_id: str,
+) -&gt; bool
+</code></pre>
+<p>Called when processing an invitation using a third-party identifier (also called a 3PID,
+e.g. an email address or a phone number). The module must return a <code>bool</code> indicating
+whether the inviter can invite the invitee to the given room.</p>
+<p>The inviter is represented by their Matrix user ID (e.g. <code>@alice:example.com</code>), and the
+invitee is represented by its medium (e.g. &quot;email&quot;) and its address
+(e.g. <code>alice@example.com</code>). See <a href="https://matrix.org/docs/spec/appendices#pid-types">the Matrix specification</a>
+for more information regarding third-party identifiers.</p>
+<p>For example, a call to this callback to send an invitation to the email address
+<code>alice@example.com</code> would look like this:</p>
+<pre><code class="language-python">await user_may_send_3pid_invite(
+    &quot;@bob:example.com&quot;,  # The inviter's user ID
+    &quot;email&quot;,  # The medium of the 3PID to invite
+    &quot;alice@example.com&quot;,  # The address of the 3PID to invite
+    &quot;!some_room:example.com&quot;,  # The ID of the room to send the invite into
+)
+</code></pre>
+<p><strong>Note</strong>: If the third-party identifier is already associated with a matrix user ID,
+<a href="#user_may_invite"><code>user_may_invite</code></a> will be used instead.</p>
 <h3 id="user_may_create_room"><a class="header" href="#user_may_create_room"><code>user_may_create_room</code></a></h3>
 <pre><code class="language-python">async def user_may_create_room(user: str) -&gt; bool
 </code></pre>