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.java35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/eu/siacs/conversations/xmpp/stanzas/IqPacket.java b/src/eu/siacs/conversations/xmpp/stanzas/IqPacket.java
new file mode 100644
index 00000000..1675d19d
--- /dev/null
+++ b/src/eu/siacs/conversations/xmpp/stanzas/IqPacket.java
@@ -0,0 +1,35 @@
+package eu.siacs.conversations.xmpp.stanzas;
+
+
+public class IqPacket extends AbstractStanza {
+
+ public static final int TYPE_SET = 0;
+ public static final int TYPE_RESULT = 1;
+ public static final int TYPE_GET = 2;
+
+ private IqPacket(String name) {
+ super(name);
+ }
+
+ public IqPacket(int type) {
+ super("iq");
+ switch (type) {
+ case TYPE_SET:
+ this.setAttribute("type", "set");
+ break;
+ case TYPE_GET:
+ this.setAttribute("type", "get");
+ break;
+ case TYPE_RESULT:
+ this.setAttribute("type", "result");
+ break;
+ default:
+ break;
+ }
+ }
+
+ public IqPacket() {
+ super("iq");
+ }
+
+}