powered by Jive Software

Resend roster

Hi everyone.

Short question: Is there a way to resend the roster to a user ?

Reason: I wrote a plugin to rebuild our companystructure in jivemessenger aka wildfire aka openfire.

The plugin is triggerd by an rpc, it moves user between shared groups and eventually creates an new additional shared group.

The problem is that sometimes PSI doesn’'t get the right roster and it will only change after a complete logout/login :/.

Edit: Still using Wildfire 3.1.1

Ok, I read and played a little bit around with the iq-packets and found some older threads but no answer.

The current state is that I can create shared groups and add user but no roster updates are send to the client (checked it with the psi xml-console).

So is there a way to force a roster update without a client requesting jabber:iq:roster ?


btw, in some iq-handler classes there are references like “http://www.jivesoftware.org/protocol/sharedgroup”, maybe this should be updated

Yeah, found it.

When you dig deep enough in the (wild|open|camping)fire classes everything can be found.

So the question is answered and I will add a little code example when I’'m done here. Maybe it can be usefull for someone

Wow, Finn, I have exactly the same task. It is sad I didn’‘t read your messages earlier. I’'ve been trying to find answers in this thread http://www.igniterealtime.org/forum/thread.jspa?threadID=25035&tstart=0. Can you please share your findings on possible solution?



Hi Eugene,

you can do this within two steps.

First you have to resend the roster by using something like this

IQ returnPacket = null;

Roster cachedRoster = pUser.getRoster ();

returnPacket = cachedRoster.getReset();

returnPacket.setType (IQ.Type.set);

returnPacket.setTo (this.getJid (pUser.getUsername ()));

returnPacket.setID (String.valueOf (tmSharedGroups.random.nextInt (1000) + “-” + tmSharedGroups.sequence++ ));


In the second step it was usefull to broadcast the presences of the user within the roster.

This can be done with something like this


  • Broadcasts the presence of the given user to all roster subscribers

  • @param pUser The user


private void broadcastPresence (User pUser) {

this.debug (“Called broadcastPresence”);

this.debug ("Argument pUser -> " + pUser.toString ());

Roster roster = null;

this.debug (“Retrieving roster”);

roster = pUser.getRoster ();

this.debug (“Broadcasting user presence”);

roster.broadcastPresence(this.presenceManager.getPresence (pUser));

} // END -> private void broadcastPresence (String pUserName)

I hope this is what you need

Hi Finn,

Thanks, I got your approach. I will try it.