Commit d86aaa6e authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Include only one list in the answer when getting a specific list. JM-785

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@4602 b35dd754-fafc-0310-a699-88a17e54d16e
parent 316d55a4
...@@ -187,6 +187,7 @@ public class IQPrivacyHandler extends IQHandler ...@@ -187,6 +187,7 @@ public class IQPrivacyHandler extends IQHandler
} }
if (list != null) { if (list != null) {
// Add the privacy list to the result // Add the privacy list to the result
childElement = result.setChildElement("query", "jabber:iq:privacy");
childElement.add(list.asElement()); childElement.add(list.asElement());
} }
else { else {
...@@ -360,13 +361,15 @@ public class IQPrivacyHandler extends IQHandler ...@@ -360,13 +361,15 @@ public class IQPrivacyHandler extends IQHandler
try { try {
sessionManager.userBroadcast(from.getNode(), pushPacket); sessionManager.userBroadcast(from.getNode(), pushPacket);
} }
catch (UnauthorizedException e) {} catch (UnauthorizedException e) {
// Ignore
}
return result; return result;
} }
private IQ deleteList(IQ packet, JID from, String listName) { private IQ deleteList(IQ packet, JID from, String listName) {
ClientSession currentSession = null; ClientSession currentSession;
IQ result = IQ.createResultIQ(packet); IQ result = IQ.createResultIQ(packet);
Element childElement = packet.getChildElement().createCopy(); Element childElement = packet.getChildElement().createCopy();
result.setChildElement(childElement); result.setChildElement(childElement);
......
...@@ -119,7 +119,9 @@ public class PrivacyList implements Cacheable { ...@@ -119,7 +119,9 @@ public class PrivacyList implements Cacheable {
* @return an Element with the privacy list XML representation. * @return an Element with the privacy list XML representation.
*/ */
public Element asElement() { public Element asElement() {
Element listElement = DocumentFactory.getInstance().createDocument().addElement("list"); //Element listElement = DocumentFactory.getInstance().createDocument().addElement("list");
Element listElement = DocumentFactory.getInstance().createDocument()
.addElement("list", "jabber:iq:privacy");
listElement.addAttribute("name", getName()); listElement.addAttribute("name", getName());
// Add the list items to the result // Add the list items to the result
for (PrivacyItem item : items) { for (PrivacyItem item : items) {
......
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