Class ClientSession
Owns the MatrixClient: resumes the stored session or logs in, and stores new sessions.
Inherited Members
Namespace: Uniform.Matrix.Client.Services
Assembly: Uniform.Matrix.Client.dll
Syntax
public sealed class ClientSession
Constructors
| Edit this page View SourceClientSession(IHttpClientFactory, ClientStore, ICredentialPrompt, AccountPaths, IOptions<MatrixOptions>, ILogger<ClientSession>)
Create the session owner.
Declaration
public ClientSession(IHttpClientFactory httpFactory, ClientStore store, ICredentialPrompt prompt, AccountPaths paths, IOptions<MatrixOptions> options, ILogger<ClientSession> logger)
Parameters
| Type | Name | Description |
|---|---|---|
| IHttpClientFactory | httpFactory | |
| ClientStore | store | |
| ICredentialPrompt | prompt | |
| AccountPaths | paths | |
| IOptions<MatrixOptions> | options | |
| ILogger<ClientSession> | logger |
Fields
| Edit this page View SourceHttpClientName
Name of the IHttpClientFactory client used for Matrix requests.
Declaration
public const string HttpClientName = "matrix"
Field Value
| Type | Description |
|---|---|
| string |
Properties
| Edit this page View SourceWhenReady
Task that completes with the logged-in client once ConnectAsync(CancellationToken) succeeds.
Declaration
public Task<MatrixClient> WhenReady { get; }
Property Value
| Type | Description |
|---|---|
| Task<MatrixClient> |
Methods
| Edit this page View SourceConnectAsync(CancellationToken)
Resume the stored session when the server still accepts it, otherwise log in with a password; return the logged-in client.
Declaration
public Task<MatrixClient> ConnectAsync(CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<MatrixClient> |