How to modify OWN Presence?

Hi guys,

I’'m working on an IM application, and I cant find any solution for this problem:

  • I create a new XMPPConnection con,

  • I get the roster from the con object, and add a RosterListener:

  • then I can easily read all information about presence modifications of all user entries in the roster…

But my big problem is that I dont know how to modify my OWN presence and then notify all users of my roster!!!

Please help!

elhit007

something like this?

Presence p = new Presence(Presence.Type.AVAILABLE, "woot", 5, Presence.Mode.AWAY);
connection.sendPacket(p);

Which would set you to away, with the priority of 5 and the status message “woot”

What do you mean notify users of your roster?

I think that when you send the presence packet to the server, it propogates that information to anyone subscribed to your presence. You don’'t need to inform anyone any further.

Also, you might not know that when you log in, your presence is automatically set to available. Just to save you a couple lines of code

Thank you guys…

it’'s really what I needed!