Commit 0fd07881 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Fixed incorrect namespace.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@648 b35dd754-fafc-0310-a699-88a17e54d16e
parent 2a90f667
......@@ -22,6 +22,7 @@ import java.util.Iterator;
import java.util.List;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.dom4j.QName;
import org.xmpp.packet.IQ;
import org.xmpp.packet.PacketError;
import org.xmpp.packet.JID;
......@@ -99,16 +100,14 @@ public class IQDiscoInfoHandler extends IQHandler {
Iterator identities = infoProvider.getIdentities(name, node, packet.getFrom());
while (identities.hasNext()) {
identity = (Element)identities.next();
identity.setQName(new QName(identity.getName(), queryElement.getNamespace()));
queryElement.add((Element)identity.clone());
}
// Add to the reply all the features provided by the DiscoInfoProvider
Element featureElement;
Iterator features = infoProvider.getFeatures(name, node, packet.getFrom());
while (features.hasNext()) {
featureElement = DocumentHelper.createElement("feature");
featureElement.addAttribute("var", (String)features.next());
queryElement.add(featureElement);
queryElement.addElement("feature").addAttribute("var", (String)features.next());
}
// Add to the reply the extended info (XDataForm) provided by the DiscoInfoProvider
......
......@@ -17,6 +17,7 @@ import java.util.Iterator;
import java.util.List;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.dom4j.QName;
import org.jivesoftware.messenger.IQHandlerInfo;
import org.jivesoftware.messenger.XMPPServer;
import org.jivesoftware.messenger.spi.BasicServer;
......@@ -52,7 +53,7 @@ import org.xmpp.packet.PacketError;
public class IQDiscoItemsHandler extends IQHandler implements ServerFeaturesProvider {
private HashMap entities = new HashMap();
private List serverItems = new ArrayList();
private List<Element> serverItems = new ArrayList<Element>();
private IQHandlerInfo info;
private IQDiscoInfoHandler infoHandler;
......@@ -100,15 +101,16 @@ public class IQDiscoItemsHandler extends IQHandler implements ServerFeaturesProv
//String node = metaData.getProperty("query:node");
// Check if we have items associated with the requested name and node
Iterator itemsItr = itemsProvider.getItems(name, node, packet.getFrom());
Iterator<Element> itemsItr = itemsProvider.getItems(name, node, packet.getFrom());
if (itemsItr != null) {
Element queryElement = reply.getChildElement();
// Add to the reply all the items provided by the DiscoItemsProvider
Element item;
while (itemsItr.hasNext()) {
item = (Element)itemsItr.next();
queryElement.add((Element)item.clone());
item = itemsItr.next();
item.setQName(new QName(item.getName(), queryElement.getNamespace()));
queryElement.add(item.createCopy());
}
;
}
......@@ -211,7 +213,7 @@ public class IQDiscoItemsHandler extends IQHandler implements ServerFeaturesProv
private DiscoItemsProvider getServerItemsProvider() {
DiscoItemsProvider discoItemsProvider = new DiscoItemsProvider() {
public Iterator getItems(String name, String node, JID senderJID)
public Iterator<Element> getItems(String name, String node, JID senderJID)
throws UnauthorizedException {
return serverItems.iterator();
}
......
......@@ -17,6 +17,7 @@ import java.util.Iterator;
import java.util.List;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.dom4j.QName;
import org.jivesoftware.messenger.forms.FormField;
/**
......@@ -64,7 +65,7 @@ public class XFormFieldImpl implements FormField {
}
public Element asXMLElement() {
Element field = DocumentHelper.createElement("field");
Element field = DocumentHelper.createElement(QName.get("field", "jabber:x:data"));
if (getLabel() != null) {
field.addAttribute("label", getLabel());
}
......
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