powered by Jive Software

List of all users in muc

Hi, plz help.

How can i get list of all users in multi user chat?

Resolved

Roster roster = connection.getRoster();

Iterator pres_map = roster.getPresences(roomID);
while(pres_map.hasNext()){
Presence next = pres_map.next();
String userid = next.getFrom();
String displayName = StringUtils.parseResource(userid);
System.out.println(displayName);
}

Or you could simply use MultiUserChat.getOccupants()

I tried it, but in moderated chats it was privilegies error.