Commit ea81dc86 authored by Roman S's avatar Roman S

Merge pull request #145 from sco0ter/of474

OF-474 OpenFire still provides entry forms for already-registered room users
parents 746a195a 3df71ba3
......@@ -141,18 +141,20 @@ class IQMUCRegisterHandler {
if (nickname != null) {
// The user is already registered with the room so answer a completed form
ElementUtil.setProperty(currentRegistration, "query.registered", null);
currentRegistration.addElement("username").addText(nickname);
Element form = currentRegistration.element(QName.get("x", "jabber:x:data"));
@SuppressWarnings("unchecked")
Iterator<Element> fields = form.elementIterator("field");
Element field;
while (fields.hasNext()) {
field = fields.next();
if ("muc#register_roomnick".equals(field.attributeValue("var"))) {
field.addElement("value").addText(nickname);
}
}
currentRegistration.remove(form);
// @SuppressWarnings("unchecked")
// Iterator<Element> fields = form.elementIterator("field");
//
// Element field;
// while (fields.hasNext()) {
// field = fields.next();
// if ("muc#register_roomnick".equals(field.attributeValue("var"))) {
// field.addElement("value").addText(nickname);
// }
// }
reply.setChildElement(currentRegistration);
}
else {
......
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