aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/utils/XmppSendUtil.java
diff options
context:
space:
mode:
authorsteckbrief <steckbrief@chefmail.de>2016-01-13 16:49:06 +0100
committersteckbrief <steckbrief@chefmail.de>2016-01-13 16:49:06 +0100
commit7e44ff92d7d9094207d0a0b1639a88c5fd6e8ccc (patch)
treeb6a0ffea7a3b7cf798c3ec8002e9652ba4908232 /src/main/java/de/thedevstack/conversationsplus/utils/XmppSendUtil.java
parent06398afd4002cf506e74cb471a2f7dd89f3810f7 (diff)
parent8644c4676a5fda9d642244ff70e72c5fe524a24d (diff)
Merge remote-tracking branch 'remotes/origin/trz/rename' into trz/rebase
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/utils/XmppSendUtil.java')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/utils/XmppSendUtil.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/utils/XmppSendUtil.java b/src/main/java/de/thedevstack/conversationsplus/utils/XmppSendUtil.java
new file mode 100644
index 00000000..74e65857
--- /dev/null
+++ b/src/main/java/de/thedevstack/conversationsplus/utils/XmppSendUtil.java
@@ -0,0 +1,26 @@
+package de.thedevstack.conversationsplus.utils;
+
+import eu.siacs.conversations.entities.Account;
+import eu.siacs.conversations.xmpp.OnIqPacketReceived;
+import eu.siacs.conversations.xmpp.XmppConnection;
+import eu.siacs.conversations.xmpp.stanzas.IqPacket;
+import eu.siacs.conversations.xmpp.stanzas.PresencePacket;
+
+/**
+ * Created by tzur on 09.01.2016.
+ */
+public class XmppSendUtil {
+ public static void sendIqPacket(Account account, IqPacket packet, OnIqPacketReceived callback) {
+ final XmppConnection connection = account.getXmppConnection();
+ if (connection != null) {
+ connection.sendIqPacket(packet, callback);
+ }
+ }
+
+ public static void sendPresencePacket(Account account, PresencePacket packet) {
+ XmppConnection connection = account.getXmppConnection();
+ if (connection != null) {
+ connection.sendPresencePacket(packet);
+ }
+ }
+}