1
votes

I'm trying to develop a chat client using Smack api with Openfire. I've been searching for couple of days on how to retrieve all users from Openfire. I tried adding all the users to a group and tried fetching it :

Roster roster = conn.getRoster();
RosterGroup grp = roster.getGroup("GroupName");
Collection<RosterEntry> ent = grp.getEntries();
for(RosterEntry rosEnt : ent){
 System.out.println(rosEnt.getUser());
}

But this prints only the current user. I also noticed something called Shared Group but did not know how to create one. Is there a way to fetch all users?

1

1 Answers

0
votes

I think this is what u looking for its may be

Roster roster = connection.getRoster();
Collection<RosterEntry> entries = roster.getEntries();
for (RosterEntry entry : entries) {
    System.out.println(entry);
}

when u getting entries try to print all of that.