O'Reilly logo

Mastering Internet of Things by Peter Waher

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Reacting to roster events

Changes to the roster may occur for different reasons. You might change the roster yourself. Another application, logged in to the same account as you, may change the roster. And those that you have presence subscriptions to may change the state of the subscription. Your application therefore needs to respond to changes in the roster, to maintain its state of operation. There are three events you need to listen to: when roster items are added, updated, or deleted:

this.xmppClient.OnRosterItemAdded += 
   XmppClient_OnRosterItemAdded; 
this.xmppClient.OnRosterItemUpdated += 
   XmppClient_OnRosterItemUpdated; 
this.xmppClient.OnRosterItemRemoved += 
   XmppClient_OnRosterItemRemoved; 

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required