O'Reilly logo

Practical XMPP by David Koelle, Lloyd Watkin

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

<presence/>

Presence is all about communicating the current state or availability. If you think about IM systems, then this is the online, busy, away, or offline status of another user. For real-time communications, it is important to know whether another user is available when you send them a message so that you can (hopefully) receive a timely response.

The following is an example of a user sending their presence to their XMPP server (note that this can be achieved by not setting the to attribute), telling the server that they are online and ready to receive push updates. For example if Marty arrived late at school because Doc Brown set all the clocks incorrectly, he can also set a status message:

<presence from="marty@mcfly.fam/highschool"> <show>available</show> ...

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