Class ClientDialogs
Modal dialogs of the client: first sign-in and creating an account, room directory, reactions, devices and the image viewer; call on the UI thread. General dialogs are in Dialogs.
Inherited Members
Namespace: Uniform.Chat.Terminal.Ui
Assembly: Uniform.Chat.dll
Syntax
public static class ClientDialogs
Fields
| Edit this page View SourceUserPolicyUrl
Address of the app's user policy, which people accept by signing in.
Declaration
public const string UserPolicyUrl = "https://github.com/tagcode/Uniform.Chat/blob/main/user-docs/Uniform.Chat.Android/user-policy.md"
Field Value
| Type | Description |
|---|---|
| string |
Methods
| Edit this page View SourceAskSignIn(IApplication, string?, string?)
Ask for the user ID and, when needed, the server address on first start, and whether to create the account; return them, or null when cancelled.
Declaration
public static (string UserId, string? Homeserver, bool CreateAccount)? AskSignIn(IApplication app, string? userId, string? homeserver)
Parameters
| Type | Name | Description |
|---|---|---|
| IApplication | app | Running application. |
| string | userId | User ID to show at first, e.g. an invalid one from the command line. |
| string | homeserver | Server address to show at first. |
Returns
| Type | Description |
|---|---|
| (string UserId, string Homeserver, bool CreateAccount)? |
ChooseDeviceAction(IApplication, IReadOnlyList<Device>, string?, Func<string, string>?)
Show devices; return the chosen action (1 rename, 2 log out device, 3 log out all others, 4 verify) and device, or null when closed.
Declaration
public static (int Action, Device? Device)? ChooseDeviceAction(IApplication app, IReadOnlyList<Device> devices, string? ownDeviceId, Func<string, string>? trust = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IApplication | app | Running application. |
| IReadOnlyList<Device> | devices | Devices of the user. |
| string | ownDeviceId | This session's device, which cannot be logged out here. |
| Func<string, string> | trust | Trust label of a device ID, e.g. |
Returns
| Type | Description |
|---|---|
| (int Action, Device Device)? |
CreateAccount(IApplication, string, string?)
Create the account of userId: ask for a password twice, then the registration token and the server's policies when it has them; return the password to sign in with, or null when cancelled.
Declaration
public static string? CreateAccount(IApplication app, string userId, string? homeserver)
Parameters
| Type | Name | Description |
|---|---|---|
| IApplication | app | Running application. |
| string | userId | User ID to create. |
| string | homeserver | Server address, or null to find it from the user ID. |
Returns
| Type | Description |
|---|---|
| string |
PickPublicRoom(IApplication, string, Func<string?, string?, Task<IReadOnlyList<PublicRoom>>>)
Let the user search the public room directory of their server or another one; return the room to join with the server it was listed on, or null.
Declaration
public static (MatrixLink Room, string Server)? PickPublicRoom(IApplication app, string server, Func<string?, string?, Task<IReadOnlyList<PublicRoom>>> search)
Parameters
| Type | Name | Description |
|---|---|---|
| IApplication | app | Running application. |
| string | server | Server to show at first; empty for the user's own. |
| Func<string, string, Task<IReadOnlyList<PublicRoom>>> | search | Searches the directory of a server, null for the user's own, for a term, or lists rooms when the term is null; runs off the UI thread. |
Returns
| Type | Description |
|---|---|
| (MatrixLink Room, string Server)? |
PickReaction(IApplication)
Ask for a reaction from common emoji or typed text; return null when cancelled.
Declaration
public static string? PickReaction(IApplication app)
Parameters
| Type | Name | Description |
|---|---|---|
| IApplication | app |
Returns
| Type | Description |
|---|---|
| string |
ShowImage(IApplication, string, DecodedImage)
Show image in a viewer: real pixels through Kitty or Sixel when the terminal supports them, colored cells otherwise.
Declaration
public static void ShowImage(IApplication app, string title, DecodedImage image)
Parameters
| Type | Name | Description |
|---|---|---|
| IApplication | app | |
| string | title | |
| DecodedImage | image |