Commit 6508fab2 authored by Derek DeMoro's avatar Derek DeMoro Committed by derek

Use better error message.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@824 b35dd754-fafc-0310-a699-88a17e54d16e
parent f96a6bd9
...@@ -56,15 +56,20 @@ public class IQPrivateHandler extends IQHandler implements ServerFeaturesProvide ...@@ -56,15 +56,20 @@ public class IQPrivateHandler extends IQHandler implements ServerFeaturesProvide
} }
public IQ handleIQ(IQ packet) throws UnauthorizedException, PacketException { public IQ handleIQ(IQ packet) throws UnauthorizedException, PacketException {
IQ replyPacket = null; IQ replyPacket = null;
Element dataElement = packet.getChildElement(); Element child = packet.getChildElement();
Element dataElement = (Element) child.elementIterator().next();
if (dataElement != null) { if (dataElement != null) {
if (IQ.Type.get.equals(packet.getType())) { if (IQ.Type.get.equals(packet.getType())) {
replyPacket = IQ.createResultIQ(packet); replyPacket = IQ.createResultIQ(packet);
Element dataStored = privateStorage.get(packet.getFrom().getNode(), dataElement); Element dataStored = privateStorage.get(packet.getFrom().getNode(), dataElement);
dataStored.setParent(null); dataStored.setParent(null);
replyPacket.setChildElement(dataStored);
child.remove(dataElement);
child.setParent(null);
replyPacket.setChildElement(child);
child.add(dataStored);
} }
else { else {
privateStorage.add(packet.getFrom().getNode(), dataElement); privateStorage.add(packet.getFrom().getNode(), dataElement);
......
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