How to get info on MUC room occupants?

Hi all,

In the client I am working on I have managed to get MUC room working, with users able to join and chat.

I’‘m writing a panel to display all those who are in the room. To get this information i’'m currently using the following code.

Iterator x = multiChat.getOccupants();

This however does not seem to be stable/reliant! Two users can be a room, sending messsages to the room which are properly broadcast, and yet when I can the following code:

System.out.println(x.hasNext());

It returns false, meaning that that x is empty (i call the above code before iterating through it), even when i know people are in the room.

The javadoc for getOccupants() states that:

“Note: this value will only be accurate after joining the group chat, and may fluctuate over time.”

Does the last bit mean this is not a reliable way to get this information? If so are there any other ways to get complete and accurate information on who is and who is not in the room?

Dwarfer

I forgot to add that

Iterator x = multiChat.getOccupants();

does sometimes work but not always. Is there a dependable way of getting this information, or is maybe due to users not being logged in to the room properly?

This thrid post is a mistake.

Message was edited by: dwarfer