The presence notifications we’ve looked at so far have been
broadcast—that is, they are sent to everyone in
your roster (you indicate that you want a presence notification to be
broadcast by leaving off the
to address). But what
if you want to send presence to someone who is not in your roster?
Perhaps you want to chat with someone for a little while but don’t
want to add that person to your roster and therefore share presence on
a permanent basis. In this case, you can send directed
presence to the other person, i.e., presence that has a
Consider what happens when Alice goes down the rabbit hole and meets the White Rabbit. Because the rabbit isn’t in her roster, she sends a message but also sends directed presence:
<message from="firstname.lastname@example.org/rabbithole" to="email@example.com" type="chat"> <body>If you please, sir--</body> </message> <presence from="firstname.lastname@example.org/rabbithole" to="email@example.com"/>
The White Rabbit is too frightened to reply, but his IM client at least sends directed presence back to Alice:
<presence from="firstname.lastname@example.org/mobile" to="email@example.com/rabbithole" type="unavailable"/>
This kind of temporary presence sharing without a long-term subscription is a best practice for brief interactions over the network. And as we’ll see in Chapter 4, directed presence is also used to join and leave multi-user chat rooms (another form of temporary interaction).