What is the intended protocol when organizing roster entries into roster groups? I need to know how the API intended the message protocol to be in these situations. Currently what happens is I need to relog for the roster to be updated on the client after adding entries to groups, so I’m obviously doing something wrong. I first assumed that these changes would be pushed from the server so that the rosterListener fires, similar to what happens with presence changes, but at the moment the server doesn’t seem to do anything.
The application autoaccepts all subscription requests. Here is a stripped down example of what happens, I hope it makes things clearer:
//This populates the visual roster with roster entries
private void addEntryToList(RosterEntry entry) {
//Entry is not associated with any groups
if(entry.getGroups().isEmpty()) {
xmppManager.addToDefaultGroup(entry);
}
//Entry is associated with at least one group
for (RosterGroup group : entry.getGroups()) {
rosterModel.insertNode(new RosterNode(entry), locateGroup(group));
}
}
public void addToDefaultGroup(RosterEntry entry){
//Locate default group in roster
RosterGroup group = roster.getGroup(ROSTER_DEFAULT_GROUP);
//If default group does not exist, create it
if(group == null) group = roster.createGroup(ROSTER_DEFAULT_GROUP); <---- I assumed something would happen here serverside
//Add entry to default group
try {
group.addEntry(entry);
} catch (XMPPException ex) {
Logger.getLogger(ChatPluginModel.class.getName()).log(Level.SEVERE, null, ex);
}
}
Any help is appreciated!
Please let me know if I did not explain the issue well enough and I will try to provide further information.