Class SecurityViewModel
Encryption status of this device and the account, with what is missing: set up recovery, recover with a key, or verify with another device; also the blocked users, and deleting the account.
Inheritance
SecurityViewModel
Assembly: Uniform.Chat.Avalonia.dll
public sealed class SecurityViewModel : ViewModelBase, INotifyPropertyChanged, INotifyPropertyChanging
Constructors
|
Edit this page
View Source
Create the panel for connection.
Declaration
public SecurityViewModel(ClientConnection connection, Func<Task> recovered, Func<Task>? blockingChanged = null, Func<Task>? accountDeleted = null)
Parameters
| Type |
Name |
Description |
| ClientConnection |
connection |
The signed-in account.
|
| Func<Task> |
recovered |
Runs after keys were restored, to show messages again.
|
| Func<Task> |
blockingChanged |
Runs after a user was unblocked, to show their messages again.
|
| Func<Task> |
accountDeleted |
Runs after the account was deleted, to return to the sign-in form.
|
Properties
|
Edit this page
View Source
Declaration
[ObservableProperty]
[NotifyPropertyChangedFor("HasBlockedUsers")]
[ExcludeFromCodeCoverage]
public IReadOnlyList<string> BlockedUsers { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public bool CanRecover { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public bool CanSetUp { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public bool CanVerify { get; set; }
Property Value
Gets an IRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.SecurityViewModel.CancelDeleteAccount().
Declaration
[ExcludeFromCodeCoverage]
public IRelayCommand CancelDeleteAccountCommand { get; }
Property Value
Gets an IRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.SecurityViewModel.CancelSignOut().
Declaration
[ExcludeFromCodeCoverage]
public IRelayCommand CancelSignOutCommand { get; }
Property Value
Gets an IAsyncRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.SecurityViewModel.ConfirmDeleteAccountAsync().
Declaration
[ExcludeFromCodeCoverage]
public IAsyncRelayCommand ConfirmDeleteAccountCommand { get; }
Property Value
Gets an IAsyncRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.SecurityViewModel.ConfirmSignOutAsync().
Declaration
[ExcludeFromCodeCoverage]
public IAsyncRelayCommand ConfirmSignOutCommand { get; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[NotifyPropertyChangedFor("HasDevices")]
[ExcludeFromCodeCoverage]
public IReadOnlyList<DeviceItem> Devices { get; set; }
Property Value
|
Edit this page
View Source
Get whether anyone is blocked.
Declaration
public bool HasBlockedUsers { get; }
Property Value
|
Edit this page
View Source
Declaration
public bool HasDevices { get; }
Property Value
|
Edit this page
View Source
Declaration
public bool HasNewRecoveryKey { get; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[NotifyCanExecuteChangedFor("SetUpCommand", new string[] { "RecoverCommand", "VerifyCommand" })]
[ExcludeFromCodeCoverage]
public bool IsBusy { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public bool IsDeletingAccount { get; set; }
Property Value
|
Edit this page
View Source
Declaration
public bool IsSigningOutDevice { get; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public IReadOnlyList<StatusLine> Lines { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public string Message { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public bool NeedsPassword { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[NotifyPropertyChangedFor("HasNewRecoveryKey")]
[ExcludeFromCodeCoverage]
public string NewRecoveryKey { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public string Password { get; set; }
Property Value
Gets an IAsyncRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.SecurityViewModel.RecoverAsync().
Declaration
[ExcludeFromCodeCoverage]
public IAsyncRelayCommand RecoverCommand { get; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[NotifyCanExecuteChangedFor("RecoverCommand")]
[ExcludeFromCodeCoverage]
public string RecoveryInput { get; set; }
Property Value
Gets an IAsyncRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.SecurityViewModel.SetUpAsync().
Declaration
[ExcludeFromCodeCoverage]
public IAsyncRelayCommand SetUpCommand { get; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[NotifyPropertyChangedFor("IsSigningOutDevice")]
[ExcludeFromCodeCoverage]
public DeviceItem? SigningOut { get; set; }
Property Value
Gets an IRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.SecurityViewModel.StartDeleteAccount().
Declaration
[ExcludeFromCodeCoverage]
public IRelayCommand StartDeleteAccountCommand { get; }
Property Value
Gets an IAsyncRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.SecurityViewModel.VerifyAsync().
Declaration
[ExcludeFromCodeCoverage]
public IAsyncRelayCommand VerifyCommand { get; }
Property Value
Methods
|
Edit this page
View Source
Load the status from the server and decide what to offer.
Declaration
public Task RefreshAsync()
Returns
|
Edit this page
View Source
Ask for the password to sign device out.
Declaration
public void StartSignOut(DeviceItem device)
Parameters
|
Edit this page
View Source
Unblock userId, so their messages and invites show again.
Declaration
public Task UnblockAsync(string userId)
Parameters
| Type |
Name |
Description |
| string |
userId |
|
Returns
|
Edit this page
View Source
Ask one device to verify this one, or to be verified by it.
Declaration
public Task VerifyDeviceAsync(DeviceItem device)
Parameters
Returns
Implements