Password protected MultiUserChat?


I’‘m trying to create a password-protected MutliUserChat and am having no luck at it whatsover. That is, I’‘m able to create a MUC just fine, but the password protected part isn’'t coming through. Actually, for that matter, none of the configuration seems to be coming through.

Here’‘s the code that I’'m using:

mConnection = new XMPPConnection(“myserver”);

mConnection.login(“username”, “password”);

mChat = new MultiUserChat(mConnection, "");


Form form = mChat.getConfigurationForm();

// Create a new form to submit based on the original form

Form submitForm = form.createAnswerForm();

// Add default answers to the form to submit

for (Iterator fields = form.getFields(); fields.hasNext():wink: {

FormField field = (FormField);

System.out.println("got field " + field.getVariable());

if (“password_protected”.equalsIgnoreCase(field.getVariable())) {

submitForm.setAnswer(“password_protected”, true);

System.out.println(“setting " + field.getVariable() + " to true.”);

} else if (“password”.equalsIgnoreCase(field.getVariable())) {

submitForm.setAnswer(“password”, “testme”);

System.out.println(“setting " + field.getVariable() + " to testme.”);

} else if (“title”.equalsIgnoreCase(field.getVariable())) {

submitForm.setAnswer(“title”, “password test room”);

System.out.println(“setting " + field.getVariable() + " to password test room.”);

} else if (“public”.equalsIgnoreCase(field.getVariable())) {

submitForm.setAnswer(“public”, false);

System.out.println(“setting " + field.getVariable() + " to false.”);

} else if (!FormField.TYPE_HIDDEN.equals(field.getType()) && field.getVariable() != null) {

// Sets the default value as the answer

System.out.println("setting default answer for " + field.getVariable());






…And the Chat is created exactly as if I’'d just sent an empty form back.

Is there something that I’'m missing here? This really seems to me like it should work…