powered by Jive Software

Presence Problems

Hi again

Let me just start off by saying Smack is an excellent library and my project is coming along excellently. Thanks for the help given so far.

I am having a few problems with presence and the roster. I currently have left the auto-subscribe feature on for now. Hopefully someone could point me in the direction of a solution. BTW I’'m using Jive Messenger as the server.

  1. When I add a user to the Roster, it shows up. However if I log out and log in again, that user is no longer on my roster. If I look at Jive Messengers database, I can see the roster entries.

  2. While rendering out the above roster, all the details are delivered except that the presence is null:

while (items.hasNext()) {

RosterEntry entry = (RosterEntry) items.next();

Presence userPresence = roster.getPresence(entry.getUser());

My webclient refreshes this on a mouse click, no matter how many times I request the roster userPresence is always null.

Many thanks

Colin

Ok, this is an odd one. I changed the subscription mode to:

roster.setSubscriptionMode(Roster.SUBSCRIPTION_MANUAL);

and now all of the above works perfectly… however I dont seem to be getting any subscription requests, instead my subscriptions are still being done automatically.

I think I’'ve boo-booed but Im not sure where.

Turning on Smack debug and looking at what’'s going on in the XML is probably the best next step. You can see what subscription requests are being generated and how Smack replies. If you find anything that looks wrong, please let us know.

Thanks,

Matt

Just as a note, XMPP roster subscriptions requires participation from all three entities involved, the requester, the server, and the recipient. So the requester makes the sub request, the server notes it, and the recipient must then approve it. When the approval is sent from the recipient, the server once again updates it’'s copy of the roster, and then informs the original requestor that roster changes have been made.

So to test roster subscriptions you’'ll need to have two clients running (the requseter and the recipient) in order to see the entire roster exchange and complete the roster transaction.

-iain