Hello all,
Sorry for all of the posting today.
I am trying to retrieve a listing of users that are currently in a MUC.
First I tried getOccupants() like so:
public String getAllUsers(Object muc)throws XMPPException
{
String allUsers = null;
MultiUserChat Muc = (MultiUserChat) muc;
System.out.println(Muc.getOccupantsCount());
Iterator it = Muc.getOccupants();
while(it.hasNext())
{
String allUser = (String)it.next();
}
return allUsers;
}
/code
This returns null.
Then I tried MUC.getParticipants() like so:
public String getAllUsers(Object muc)throws XMPPException
{
String allUsers = null;
MultiUserChat Muc = (MultiUserChat) muc;
System.out.println(Muc.getOccupantsCount()); //This returns the proper number
List list = (List) Muc.getParticipants();
Iterator it = list.iterator();
while(it.hasNext())
{
String allUser = (String)it.next();
System.out.println("allUsers = "+allUsers);
}
return allUsers;
}
/code
This returns a 403
(403)
at org.jivesoftware.smackx.muc.MultiUserChat.getOccupants(MultiUserChat.java:1762)
at org.jivesoftware.smackx.muc.MultiUserChat.getParticipants(MultiUserChat.java:17 29)
at chatPackage.WebConnect.getAllUsers(WebConnect.java:344)
Am I totally off base here in my code?
Any ideas?
Thanks!