private void OnUnfriendHandler(XmppClient Client, XmlElement Element, string From, string To) { string Jid = XmppClient.StripResource(XmlUtilities.GetAttribute(Element, "jid", string.Empty)); JidEventHandler h = this.OnUnfriend; if (h == null) { XmppContact Contact = this.client.GetLocalContact(Jid); if (Contact != null) { this.client.DeleteContact(Contact); } } else { JidEventArgs e = new JidEventArgs(Jid); try { h(this, e); } catch (Exception ex) { Log.Exception(ex); } } }
private void OnFriendHandler(XmppClient Client, XmlElement Element, string From, string To) { string Jid = XmppClient.StripResource(XmlUtilities.GetAttribute(Element, "jid", string.Empty)); JidEventHandler h = this.OnFriend; if (h == null) { this.client.RequestPresenceSubscription(Jid); } else { JidEventArgs e = new JidEventArgs(Jid); try { h(this, e); } catch (Exception ex) { Log.Exception(ex); } } }