March 2018
Beginner to intermediate
410 pages
10h 40m
English
Apart from connecting to the XMPP network, we need a way to manage our roster, or who our friends are. In this chapter, we will use the simplest, but not safest, approach, by accepting all presence subscription requests:
private void AttachFeatures() { this.xmppClient.OnPresenceSubscribe += (Sender, e) => { Log.Informational("Accepting friendship request.", this.xmppClient.BareJID, e.From); e.Accept(); }; this.xmppClient.OnPresenceUnsubscribe += (Sender, e) => { Log.Informational("Friendship removed.", this.xmppClient.BareJID, e.From); e.Accept(); }; this.xmppClient.OnPresenceSubscribed += (Sender, e) => Log.Informational("Friendship request accepted.", this.xmppClient.BareJID, e.From); this.xmppClient.OnPresenceUnsubscribed ...Read now
Unlock full access