1using CommunityToolkit.Mvvm.ComponentModel;
2using CommunityToolkit.Mvvm.Input;
34 private readonly TaskCompletionSource<PresenceRequestAction> result =
new();
47 this.BareJid = BareJid;
48 this.FriendlyName = FriendlyName;
49 this.PhotoUrl = PhotoUrl;
50 this.PhotoWidth = PhotoWidth;
51 this.PhotoHeight = PhotoHeight;
52 this.HasFriendlyName = !
string.IsNullOrEmpty(FriendlyName) && FriendlyName != BareJid;
53 this.HasPhoto = !
string.IsNullOrEmpty(PhotoUrl);
55 if (this.hasFriendlyName)
57 this.PrimaryName = FriendlyName;
58 this.SecondaryName =
" (" + BareJid +
")";
62 this.PrimaryName = BareJid;
63 this.SecondaryName =
string.Empty;
71 private string bareJid;
77 private string friendlyName;
83 private string primaryName;
89 private string secondaryName;
95 private bool hasFriendlyName;
101 private bool hasPhoto;
107 private string? photoUrl;
113 private int photoWidth;
119 private int photoHeight;
124 public Task<PresenceRequestAction>
Result => this.result.Task;
130 private async Task Accept()
133 await MopupService.Instance.PopAsync();
140 private async Task Reject()
143 await MopupService.Instance.PopAsync();
149 internal void Close()
A base class for all view models, inheriting from the BindableObject. NOTE: using this class requir...