From a05e2ca182aa4fa30c050df05eec1ecaa892774e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Sat, 22 Feb 2025 16:57:35 +0100 Subject: [PATCH] Clarify SS API third party invites explanations and add more cross-API links MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kévin Commaille --- content/server-server-api.md | 44 +++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/content/server-server-api.md b/content/server-server-api.md index 8e99c431..272bfb26 100644 --- a/content/server-server-api.md +++ b/content/server-server-api.md @@ -970,9 +970,8 @@ the event to other servers in the room. ## Third-party invites {{% boxes/note %}} -More information about third-party invites is available in the -[Client-Server API](/client-server-api) under -the Third-party Invites module. +More information about third-party invites is available in the Client-Server API +under the [Third-party invites](/client-server-api/#third-party-invites) module. {{% /boxes/note %}} When a user wants to invite another user in a room but doesn't know the @@ -985,38 +984,41 @@ API](/identity-service-api). ### Cases where an association exists for a third-party identifier -If the third-party identifier is already bound to a Matrix ID, a lookup -request on the identity server will return it. The invite is then -processed by the inviting homeserver as a standard `m.room.member` -invite event. This is the simplest case. +If the third-party identifier is already bound to a Matrix ID, a [lookup +request](/identity-service-api/#post_matrixidentityv2lookup) on the identity +server will return it. The invite is then processed by the inviting homeserver +as a [standard `m.room.member` invite event](#inviting-to-a-room). This is the +simplest case. ### Cases where an association doesn't exist for a third-party identifier If the third-party identifier isn't bound to any Matrix ID, the inviting -homeserver will request the identity server to store an invite for this -identifier and to deliver it to whoever binds it to its Matrix ID. It -will also send an `m.room.third_party_invite` event in the room to -specify a display name, a token and public keys the identity server -provided as a response to the invite storage request. +homeserver will request the identity server to [store an invite](/identity-service-api/#invitation-storage) +for this identifier and to deliver it to whoever binds it to its Matrix ID. It +will also send an [`m.room.third_party_invite`](/client-server-api/#mroomthird_party_invite) +event in the room to specify a display name, a token and public keys the +identity server provided as a response to the invite storage request. -When a third-party identifier with pending invites gets bound to a -Matrix ID, the identity server will send a POST request to the ID's -homeserver as described in the [Invitation -Storage](/identity-service-api#invitation-storage) -section of the Identity Service API. +When a third-party identifier with pending invites gets bound to a Matrix ID, +the identity server will send a request to the [`/3pid/onbind`](#put_matrixfederationv13pidonbind) +endpoint of the the ID's homeserver as described in the [Invitation +Storage](/identity-service-api#invitation-storage) section of the Identity +Service API. The following process applies for each invite sent by the identity server: -The invited homeserver will create an `m.room.member` invite event -containing a special `third_party_invite` section containing the token -and a signed object, both provided by the identity server. +The invited homeserver will create an [`m.room.member`](/client-server-api/#mroommember) +invite event containing a special `third_party_invite` section containing the +token and a `signed` object, both provided by the identity server. If the invited homeserver is in the room the invite came from, it can auth the event and send it. However, if the invited homeserver isn't in the room the invite came -from, it will need to request the room's homeserver to auth the event. +from, it will need to request the inviting homeserver to auth the event +at the [`/exchange_third_party_invite`](#put_matrixfederationv1exchange_third_party_inviteroomid) +endpoint. {{% http-api spec="server-server" api="third_party_invite" %}}