Commit 39e282ae authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Ported changes from trunk. JM-1259

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/branches@9826 b35dd754-fafc-0310-a699-88a17e54d16e
parent c97831d1
...@@ -63,7 +63,7 @@ public class IQMUCSearchHandler ...@@ -63,7 +63,7 @@ public class IQMUCSearchHandler
{ {
final XDataFormImpl searchForm = new XDataFormImpl(DataForm.TYPE_FORM); final XDataFormImpl searchForm = new XDataFormImpl(DataForm.TYPE_FORM);
searchForm.setTitle("Chat Rooms Search"); searchForm.setTitle("Chat Rooms Search");
searchForm.addInstruction("instrunctions"); searchForm.addInstruction("Instructions");
final FormField typeFF = new XFormFieldImpl("FORM_TYPE"); final FormField typeFF = new XFormFieldImpl("FORM_TYPE");
typeFF.setType(FormField.TYPE_HIDDEN); typeFF.setType(FormField.TYPE_HIDDEN);
...@@ -176,13 +176,19 @@ public class IQMUCSearchHandler ...@@ -176,13 +176,19 @@ public class IQMUCSearchHandler
final FormField userAmountFF = df.getField("num_users"); final FormField userAmountFF = df.getField("num_users");
if (userAmountFF != null) if (userAmountFF != null)
{ {
numusers = Integer.parseInt(getFirstValue(userAmountFF)); String value = getFirstValue(userAmountFF);
if (value != null && !"".equals(value)) {
numusers = Integer.parseInt(value);
}
} }
final FormField maxUsersFF = df.getField("num_max_users"); final FormField maxUsersFF = df.getField("num_max_users");
if (maxUsersFF != null) if (maxUsersFF != null)
{ {
numaxusers = Integer.parseInt(getFirstValue(maxUsersFF)); String value = getFirstValue(maxUsersFF);
if (value != null && !"".equals(value)) {
numaxusers = Integer.parseInt(value);
}
} }
} }
catch (NumberFormatException e) catch (NumberFormatException e)
...@@ -334,7 +340,10 @@ public class IQMUCSearchHandler ...@@ -334,7 +340,10 @@ public class IQMUCSearchHandler
innerfield.setType(FormField.TYPE_BOOLEAN); innerfield.setType(FormField.TYPE_BOOLEAN);
innerfield.addValue(Boolean.toString(room.isMembersOnly())); innerfield.addValue(Boolean.toString(room.isMembersOnly()));
fields.add(innerfield); fields.add(innerfield);
innerfield = new XFormFieldImpl("jid");
innerfield.setType(FormField.TYPE_TEXT_SINGLE);
innerfield.addValue(room.getRole().getRoleAddress().toString());
fields.add(innerfield);
resultform.addItemFields(fields); resultform.addItemFields(fields);
atLeastoneResult = true; atLeastoneResult = true;
} }
...@@ -361,6 +370,10 @@ public class IQMUCSearchHandler ...@@ -361,6 +370,10 @@ public class IQMUCSearchHandler
rffPasswordProtected.setLabel("Is a password protected room."); rffPasswordProtected.setLabel("Is a password protected room.");
resultform.addReportedField(rffPasswordProtected); resultform.addReportedField(rffPasswordProtected);
final FormField rffJID = new XFormFieldImpl("jid");
rffJID.setLabel("JID");
resultform.addReportedField(rffJID);
FormField innerfield = new XFormFieldImpl("is_member_only"); FormField innerfield = new XFormFieldImpl("is_member_only");
innerfield.setType(FormField.TYPE_TEXT_SINGLE); innerfield.setType(FormField.TYPE_TEXT_SINGLE);
innerfield.setLabel("Is a member only room."); innerfield.setLabel("Is a member only room.");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment