Class SyncProcessor
Applies sync responses to the in-memory RoomStore and the database, and publishes the changes to the frontend.
Inheritance
SyncProcessor
Assembly: Uniform.Matrix.Client.dll
public sealed class SyncProcessor
Constructors
|
Edit this page
View Source
Create a processor persisting to store, decrypting with crypto when given.
Declaration
public SyncProcessor(ClientStore store, CryptoService? crypto = null)
Parameters
Properties
|
Edit this page
View Source
Changes of each processed sync, in order; reads by one frontend.
Declaration
public ChannelReader<SyncChanges> Changes { get; }
Property Value
Methods
|
Edit this page
View Source
Load up to limit older events of roomId from the server, stores them and prepend them to the room; return them oldest first.
Declaration
public Task<IReadOnlyList<ClientEvent>> BackfillAsync(MatrixClient client, string roomId, int limit, CancellationToken cancellationToken = default)
Parameters
Returns
|
Edit this page
View Source
Decrypt stored events whose room keys arrived since the last call, e.g. in this sync or from a backup restore, and announces their rooms.
Declaration
public Task DecryptWithReceivedKeysAsync(CancellationToken cancellationToken = default)
Parameters
Returns
|
Edit this page
View Source
Return whether the user ignores, i.e. has blocked, userId.
Declaration
public bool IsIgnored(string userId)
Parameters
| Type |
Name |
Description |
| string |
userId |
|
Returns
|
Edit this page
View Source
Load the full member list of roomId, which sync omits when lazy-loading.
Declaration
public Task LoadMembersAsync(MatrixClient client, string roomId, CancellationToken cancellationToken = default)
Parameters
Returns
|
Edit this page
View Source
Load the whole member list of joined rooms that are named after their members, i.e. have neither a name nor an alias, and whose summary is unknown; then announce them.
Declaration
public Task LoadMembersOfUnnamedRoomsAsync(MatrixClient client, CancellationToken cancellationToken = default)
Parameters
Returns
|
Edit this page
View Source
Persist sync, then apply it to the room state and publishes the changes.
Declaration
public Task ProcessAsync(SyncResponse sync, string ownUserId, CancellationToken cancellationToken)
Parameters
Returns
|
Edit this page
View Source
Run read on the room state while no sync is applied.
Declaration
public T Read<T>(Func<RoomStore?, T> read)
Parameters
Returns
Type Parameters
|
Edit this page
View Source
Try once more to decrypt every stored encrypted event, e.g. at start, for keys that arrived while an event could not be matched; return how many were decrypted.
Declaration
public Task<int> RetryStoredEncryptedAsync(CancellationToken cancellationToken = default)
Parameters
Returns
|
Edit this page
View Source
Ignore userId, i.e. block them, or stop ignoring them, on the server, and apply the new list at once; the server then leaves out their messages and invites.
Declaration
public Task SetIgnoredAsync(MatrixClient client, string userId, bool ignored, CancellationToken cancellationToken = default)
Parameters
Returns
Events
|
Edit this page
View Source
Raised with the changes of each processed sync after they are applied, for services beside the frontend, e.g. calls; on the sync loop, so handlers return quickly.
Declaration
public event Action<SyncChanges>? Applied
Event Type
|
Edit this page
View Source
Raised with a room ID after stored events of it were decrypted with a late room key, so a shown log can reload.
Declaration
public event Action<string>? EventsDecrypted
Event Type