Class RemoteEvents
Events other servers send in transactions: their senders' keys are gathered, and when they build on events this server does not have, those are asked for with get_missing_events and accepted first.
Inherited Members
Namespace: Uniform.Matrix.Server.Federation
Assembly: Uniform.Matrix.Server.dll
Syntax
public sealed class RemoteEvents
Remarks
At most MaxMissing missing events are asked for per event, one level deep. When previous or auth events are still missing after that, the sending server is asked for the state before the event; the events of that state and their auth chain that are not here are fetched one by one, and the event is checked against that state.
Constructors
| Edit this page View SourceRemoteEvents(EventSender, RemoteServerKeys, FederationClient, IDbContextFactory<ServerDbContext>, ILogger<RemoteEvents>)
Create the service.
Declaration
public RemoteEvents(EventSender sender, RemoteServerKeys keys, FederationClient federation, IDbContextFactory<ServerDbContext> contexts, ILogger<RemoteEvents> logger)
Parameters
| Type | Name | Description |
|---|---|---|
| EventSender | sender | |
| RemoteServerKeys | keys | |
| FederationClient | federation | |
| IDbContextFactory<ServerDbContext> | contexts | |
| ILogger<RemoteEvents> | logger |
Fields
| Edit this page View SourceMaxMissing
Most missing events asked for at once.
Declaration
public const int MaxMissing = 20
Field Value
| Type | Description |
|---|---|
| int |
Methods
| Edit this page View SourceAcceptAsync(string, JsonObject, CancellationToken)
Accept an event origin sent, after the events before it that are missing here; return its ID, if known, and why it was rejected, or null when stored.
Declaration
public Task<(string? EventId, string? Error)> AcceptAsync(string origin, JsonObject pdu, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | origin | |
| JsonObject | pdu | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<(string EventId, string Error)> |