Class RemoteInvites
Invites of other servers' users: the invite is signed here, sent to the invitee's server, which signs it too, and then stored like any event.
Inherited Members
Namespace: Uniform.Matrix.Server.Federation
Assembly: Uniform.Matrix.Server.dll
Syntax
public sealed class RemoteInvites
Remarks
The invitee then joins through this server's make_join and send_join. Invites the other way, to this server's users, are signed here too and kept in RemoteInviteRows until the user joins or rejects them; rejecting does not tell the other server yet.
Constructors
| Edit this page View SourceRemoteInvites(FederationClient, RemoteServerKeys, EventSender, IDbContextFactory<ServerDbContext>, ServerStream, ServerKeys, IOptionsMonitor<ServerOptions>)
Create the service.
Declaration
public RemoteInvites(FederationClient federation, RemoteServerKeys remoteKeys, EventSender sender, IDbContextFactory<ServerDbContext> contexts, ServerStream stream, ServerKeys keys, IOptionsMonitor<ServerOptions> server)
Parameters
| Type | Name | Description |
|---|---|---|
| FederationClient | federation | |
| RemoteServerKeys | remoteKeys | |
| EventSender | sender | |
| IDbContextFactory<ServerDbContext> | contexts | |
| ServerStream | stream | |
| ServerKeys | keys | |
| IOptionsMonitor<ServerOptions> | server |
Methods
| Edit this page View SourceAssertReachableAsync(string, CancellationToken)
Throw M_INVALID_PARAM for an invalid server name, and a 502 when serverName does not answer federation, e.g. a mistyped name.
Declaration
public Task AssertReachableAsync(string serverName, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | serverName | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
EndAsync(string, string, bool, CancellationToken)
End an invite: leave when rejected, which sync reports, or removed once the user has joined or the room is here; nothing without one.
Declaration
public Task EndAsync(string userId, string roomId, bool joined, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | userId | |
| string | roomId | |
| bool | joined | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
GetInvitingServerAsync(string, string, CancellationToken)
Return the server that invited userId to roomId, a room not here, or null without such an invite.
Declaration
public Task<string?> GetInvitingServerAsync(string userId, string roomId, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | userId | |
| string | roomId | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<string> |
InviteAsync(string, string, string, string, JsonObject, CancellationToken)
Invite target of targetServer to a room here, for the local user inviter.
Declaration
public Task InviteAsync(string inviter, string roomId, string target, string targetServer, JsonObject content, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | inviter | |
| string | roomId | |
| string | target | |
| string | targetServer | |
| JsonObject | content | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
ReceiveAsync(string, string, string, JsonObject, CancellationToken)
Accept an invite of a local user that origin sent: check it, sign it, keep it for the user's sync, and return it signed, as invite v2 answers.
Declaration
public Task<JsonObject> ReceiveAsync(string origin, string roomId, string eventId, JsonObject body, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | origin | Sending server, which must be the inviter's. |
| string | roomId | Room from the URL. |
| string | eventId | Event ID from the URL. |
| JsonObject | body | The request: |
| CancellationToken | cancellationToken | Cancellation token. |
Returns
| Type | Description |
|---|---|
| Task<JsonObject> |