Hi all available Helper …
As an admin, I manually created 2 public rooms (with very basic configuration and no password) in the OpenFire server … then I write a code in client app using Smack to join that rooms like below:
MultiUserChat muc = panel.getMuc();
if(muc != null){
System.out.println("Join status: " + muc.isJoined()); //----
Checking my JOIN status -
//
Iterator<String> it = muc.getOccupants();
while(it.hasNext()){
String participant = it.next();
String username = participant.substring(participant.indexOf("/") + 1, participant.length());
if(panel.getMainPanel().getRosterHandler().getContactByUsername(username + Config.getDomainPrefix()) != null){
Contact con = panel.getMainPanel().getRosterHandler().getContactByUsername(username + Config.getDomainPrefix());
panel.getListParticipantModel().addElement(con.getNickname());
} else {
panel.getListParticipantModel().addElement(username);
}
}
}
*The funny part is: My Join status check (code: muc.isJoined()
)… returned = TRUE but I cannot retrieve the occupants … WHY???*
If anybody out there had simillar problem before and already got enlightment … please help me on this … Thanks alot in advance
Bromo