Hi
Is it possible to change the group of a contact, I mean:
if first contact1 belongs to groupA, is it possible to make contact1 to belong to groupB?
thx
e07
ok, thx for reply...
that mean that method of the RosterListener are not called when you manipulate RosterEntries at RosterGroup level?
I mean, if you change group for a contact using RosterGroup methods like removeEntry() or addEntry() (as told before); the entriesAdded() and entriesDeleted() method of the RosterListener wont be call?
thx
e07
As far as I know they wont be called, but I could be wrong.
To update your gui with the correct display after you have added/removed an entry from a group you could simply call a method to redraw your roster. As long as your roster drawing code included pulling groups and their members then it should show the updated list
So something like this could be called after you have either added or deleted a RosterEntry from a RosterGroup.
Roster roster;
// Get all RosterGroups from your Roster
Iterator groupsIter = roster.getGroups();
// Loop through each group and display its members
while(groupsIter.hasNext()) {
RosterGroup rosterGroup = (RosterGroup)groupsIter.next();
System.out.println("Group: " + rosterGroup.getName());
// Get the members of each group.
Iterator groupEntries = rosterGroup.getEntries();
while(groupEntries.hasNext()) {
RosterEntry rosterEntry = (RosterEntry)groupEntries.next();
System.out.println("Contact: " + rosterEntry.getUser()):
}
}