1using CommunityToolkit.Mvvm.ComponentModel;
2using CommunityToolkit.Mvvm.Input;
8using System.Collections.ObjectModel;
32 this.navigationArguments = Args;
40 this.@
event = Args.
Event;
48 if (this.FriendlyName == this.BareJid)
51 this.RemoteFriendlyNameAvailable = this.RemoteFriendlyName != this.RemoteJid;
52 if (!this.RemoteFriendlyNameAvailable)
60 await base.OnInitializeAsync();
62 if (this.navigationArguments is not
null)
68 if (Thing?.MetaData is not
null)
75 this.CallerInContactsList = Caller is not
null;
76 if (Caller?.MetaData is not
null)
87 this.SelectedRuleRangeIndex = 0;
96 public ObservableCollection<HumanReadableTag>
Tags {
get; }
101 public ObservableCollection<HumanReadableTag>
CallerTags {
get; }
106 public ObservableCollection<RuleRangeModel>
RuleRanges {
get; }
112 private string? bareJid;
118 private string? friendlyName;
124 private string? remoteJid;
130 private string? remoteFriendlyName;
136 private bool remoteFriendlyNameAvailable;
148 private string? provisioningService;
154 private bool callerInContactsList;
160 private int selectedRuleRangeIndex;
168 private static Task Click(
object obj)
172 else if (obj is
string s)
175 return Task.CompletedTask;
182 private async Task AddContact()
184 if (!this.CallerInContactsList)
188 BareJid = this.RemoteJid,
189 FriendlyName = (this.RemoteFriendlyNameAvailable ? this.RemoteFriendlyName : this.RemoteJid) ??
string.Empty
194 this.CallerInContactsList =
true;
202 private async Task RemoveContact()
204 if (this.CallerInContactsList)
207 if (Info is not
null)
210 this.CallerInContactsList =
false;
216 return this.SelectedRuleRangeIndex
switch
228 private void Accept()
237 private void Reject()
242 private void Respond(
bool Accepts)
245 FriendshipResolver Resolver =
new(this.BareJid ??
string.Empty, this.RemoteJid ??
string.Empty, Range);
248 this.BareJid ??
string.Empty,
this.RemoteJid ??
string.Empty,
this.Key ??
string.Empty, Accepts, Range,
249 this.ResponseHandler, Resolver);
256 if (this.@event is not
null)
261 MainThread.BeginInvokeOnMainThread(async () =>
277 private async Task Ignore()
279 if (this.@event is not
null)
A strongly-typed resource class, for looking up localized strings, etc.
static string NotAvailable
Looks up a localized string similar to Not Available.
static string UnableToRespond
Looks up a localized string similar to Unable to respond to request..
static string CallerOnly
Looks up a localized string similar to Caller Only.
static string EntireDomain
Looks up a localized string similar to Everyone from {0}.
static string Everyone
Looks up a localized string similar to Everyone.
Base class that references services in the app.
static IUiService UiService
Service serializing and managing UI-related tasks.
static INotificationService NotificationService
Service for managing notifications for the user.
static ITagProfile TagProfile
TAG Profile service.
static IReportingStringLocalizer Localizer
Localization service
static IXmppService XmppService
The XMPP service for XMPP communication.
virtual async Task GoBack()
Method called when user wants to navigate to the previous screen.
Class used to present a meta-data tag in a human interface.
Holds navigation parameters specific to displaying the is-friend provisioning question.
The view model to bind to when displaying a thing.
IsFriendViewModel(IsFriendNavigationArgs? Args)
Creates an instance of the IsFriendViewModel class.
override async Task OnInitializeAsync()
Method called when view is initialized for the first time. Use this method to implement registration ...
ObservableCollection< RuleRangeModel > RuleRanges
Available Rule Ranges
ObservableCollection< HumanReadableTag > CallerTags
Holds a list of meta-data tags associated with the caller.
ObservableCollection< HumanReadableTag > Tags
Holds a list of meta-data tags associated with a thing.
string? Key
Provisioning key
string? BareJid
Bare JID of device.
ProvisioningNotificationEvent? Event
Notification event object.
string? RemoteFriendlyName
Friendly name of remote entity.
string? FriendlyName
Friendly name of device.
string? RemoteJid
Bare JID of remote entity trying to connect to device.
string? ProvisioningService
Provisioning Service
The view model to bind to for when displaying thing claim information.
static async Task LabelClicked(string Name, string Value, string LocalizedValue)
Processes the click of a localized meta-data label.
A view model that holds the XMPP state.
Event arguments for responses to IQ queries.
bool Ok
If the response is an OK result response (true), or an error response (false).
object State
State object passed to the original request.
XmppException StanzaError
Any stanza error returned.
Manages an XMPP client connection. Implements XMPP, as defined in https://tools.ietf....
static string GetDomain(string JID)
Gets the domain part of a JID.
Static interface for database persistence. In order to work, a database provider has to be assigned t...
static async Task Delete(object Object)
Deletes an object in the database.
static async Task Insert(object Object)
Inserts an object into the default collection of the database.
Interface for event resolvers. Such can be used to resolve multiple pending notifications at once.
Task DeleteEvents(NotificationEventType Type, CaseInsensitiveString Category)
Deletes events for a given button and category.
Task DeleteResolvedEvents(IEventResolver Resolver)
Deletes pending events that have already been resolved.
abstract class NotificationEvent()
Abstract base class of notification events.
class RuleRangeModel(object RuleRange, string Label)
Rule Range model
RuleRange
Range of a rule change