Class TypingService
Typing notifications, kept in memory only.
Implements
Inherited Members
Namespace: Uniform.Matrix.Server.Rooms
Assembly: Uniform.Matrix.Server.dll
Syntax
public sealed class TypingService : IDisposable
Remarks
Each change, including a typing timeout running out, takes a ServerStream position, so waiting syncs wake and incremental syncs see it.
Constructors
| Edit this page View SourceTypingService(IDbContextFactory<ServerDbContext>, ServerStream, TimeProvider, ILogger<TypingService>)
Create the service and its expiry timer.
Declaration
public TypingService(IDbContextFactory<ServerDbContext> contexts, ServerStream stream, TimeProvider time, ILogger<TypingService> logger)
Parameters
| Type | Name | Description |
|---|---|---|
| IDbContextFactory<ServerDbContext> | contexts | |
| ServerStream | stream | |
| TimeProvider | time | |
| ILogger<TypingService> | logger |
Fields
| Edit this page View SourceMaxTimeout
Longest timeout a client may ask for.
Declaration
public static readonly TimeSpan MaxTimeout
Field Value
| Type | Description |
|---|---|
| TimeSpan |
Methods
| Edit this page View SourceDispose()
Stop the timer.
Declaration
public void Dispose()
GetTypingEvent(string, long?)
Return the room's m.typing event when it changed after since, or for initial syncs (null) when someone types.
Declaration
public JsonObject? GetTypingEvent(string roomId, long? since)
Parameters
| Type | Name | Description |
|---|---|---|
| string | roomId | |
| long? | since |
Returns
| Type | Description |
|---|---|
| JsonObject |
SetTypingAsync(string, string, bool, TimeSpan, CancellationToken)
Start or stop userId typing in a room they are joined to.
Declaration
public Task SetTypingAsync(string userId, string roomId, bool typing, TimeSpan timeout, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | userId | |
| string | roomId | |
| bool | typing | |
| TimeSpan | timeout | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |