aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/xmpp/stanzas/IqPacket.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/eu/siacs/conversations/xmpp/stanzas/IqPacket.java')
-rw-r--r--src/eu/siacs/conversations/xmpp/stanzas/IqPacket.java15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/eu/siacs/conversations/xmpp/stanzas/IqPacket.java b/src/eu/siacs/conversations/xmpp/stanzas/IqPacket.java
index 1d4e44d18..9df05e678 100644
--- a/src/eu/siacs/conversations/xmpp/stanzas/IqPacket.java
+++ b/src/eu/siacs/conversations/xmpp/stanzas/IqPacket.java
@@ -2,9 +2,8 @@ package eu.siacs.conversations.xmpp.stanzas;
import eu.siacs.conversations.xml.Element;
-
public class IqPacket extends AbstractStanza {
-
+
public static final int TYPE_ERROR = -1;
public static final int TYPE_SET = 0;
public static final int TYPE_RESULT = 1;
@@ -33,25 +32,25 @@ public class IqPacket extends AbstractStanza {
break;
}
}
-
+
public IqPacket() {
super("iq");
}
-
+
public Element query() {
Element query = findChild("query");
- if (query==null) {
+ if (query == null) {
query = addChild("query");
}
return query;
}
-
+
public Element query(String xmlns) {
Element query = query();
query.setAttribute("xmlns", xmlns);
return query();
}
-
+
public int getType() {
String type = getAttribute("type");
if ("error".equals(type)) {
@@ -66,7 +65,7 @@ public class IqPacket extends AbstractStanza {
return 1000;
}
}
-
+
public IqPacket generateRespone(int type) {
IqPacket packet = new IqPacket(type);
packet.setTo(this.getFrom());