void OnSendingServiceUnavailable(object sender, SendingServiceUnavailableEventArgs e)
{
if (e.Stanza.To == null) {
// can only be received by the server
return;
}
if (e.Stanza.To == JabberClient.MyJID.Server) {
// explicitly targeting the server
return;
}
XmppPersonModel person;
if (!Contacts.TryGetValue(e.Stanza.To.Bare, out person)) {
e.Cancel = true;
return;
}
if (person.Subscription != SubscriptionType.both &&
person.Subscription != SubscriptionType.from) {
e.Cancel = true;
return;
}
// the person already knows we are online, this does not give away our privacy
}