aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/parser/IqParser.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/parser/IqParser.java')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/parser/IqParser.java21
1 files changed, 3 insertions, 18 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/parser/IqParser.java b/src/main/java/de/thedevstack/conversationsplus/parser/IqParser.java
index 35b41d61..b3cfc813 100644
--- a/src/main/java/de/thedevstack/conversationsplus/parser/IqParser.java
+++ b/src/main/java/de/thedevstack/conversationsplus/parser/IqParser.java
@@ -28,19 +28,14 @@ import de.thedevstack.conversationsplus.crypto.axolotl.AxolotlService;
import de.thedevstack.conversationsplus.entities.Account;
import de.thedevstack.conversationsplus.entities.Contact;
import de.thedevstack.conversationsplus.services.avatar.AvatarCache;
-import de.thedevstack.conversationsplus.services.avatar.AvatarService;
import de.thedevstack.conversationsplus.services.XmppConnectionService;
+import de.thedevstack.conversationsplus.utils.UiUpdateHelper;
import de.thedevstack.conversationsplus.utils.Xmlns;
-import de.thedevstack.conversationsplus.utils.XmppSendUtil;
import de.thedevstack.conversationsplus.xml.Element;
import de.thedevstack.conversationsplus.xmpp.OnIqPacketReceived;
import de.thedevstack.conversationsplus.xmpp.OnUpdateBlocklist;
-import de.thedevstack.conversationsplus.xmpp.iqversion.IqVersionPacket;
-import de.thedevstack.conversationsplus.xmpp.iqversion.IqVersionPacketGenerator;
import de.thedevstack.conversationsplus.xmpp.jid.Jid;
import de.thedevstack.conversationsplus.xmpp.stanzas.IqPacket;
-import de.thedevstack.conversationsplus.xmpp.time.TimePacket;
-import de.thedevstack.conversationsplus.xmpp.time.TimePacketGenerator;
public class IqParser extends AbstractParser implements OnIqPacketReceived {
@@ -300,7 +295,7 @@ public class IqParser extends AbstractParser implements OnIqPacketReceived {
account.getBlocklist().addAll(jids);
}
// Update the UI
- mXmppConnectionService.updateBlocklistUi(OnUpdateBlocklist.Status.BLOCKED);
+ UiUpdateHelper.updateBlocklistUi(OnUpdateBlocklist.Status.BLOCKED);
} else if (packet.hasChild("unblock", Xmlns.BLOCKING) &&
packet.fromServer(account) && packet.getType() == IqPacket.TYPE.SET) {
Logging.d(Config.LOGTAG, "Received unblock update from server");
@@ -320,21 +315,11 @@ public class IqParser extends AbstractParser implements OnIqPacketReceived {
}
account.getBlocklist().removeAll(jids);
}
- mXmppConnectionService.updateBlocklistUi(OnUpdateBlocklist.Status.UNBLOCKED);
+ UiUpdateHelper.updateBlocklistUi(OnUpdateBlocklist.Status.UNBLOCKED);
} else if (packet.hasChild("open", "http://jabber.org/protocol/ibb")
|| packet.hasChild("data", "http://jabber.org/protocol/ibb")) {
mXmppConnectionService.getJingleConnectionManager()
.deliverIbbPacket(account, packet);
- } else if (packet.hasChild("query", "http://jabber.org/protocol/disco#info")) {
- final IqPacket response = mXmppConnectionService.getIqGenerator().discoResponse(packet);
- mXmppConnectionService.sendIqPacket(account, response, null);
- } else if (packet.hasChild("query", IqVersionPacket.NAMESPACE)) {
- XmppSendUtil.sendIqPacket(account, IqVersionPacketGenerator.generateResponse(packet), null);
- } else if (packet.hasChild("ping", "urn:xmpp:ping")) {
- final IqPacket response = packet.generateResponse(IqPacket.TYPE.RESULT);
- mXmppConnectionService.sendIqPacket(account, response, null);
- } else if (packet.hasChild("time", TimePacket.NAMESPACE)) {
- XmppSendUtil.sendIqPacket(account, TimePacketGenerator.generateResponse(packet), null);
} else {
if (packet.getType() == IqPacket.TYPE.GET || packet.getType() == IqPacket.TYPE.SET) {
final IqPacket response = packet.generateResponse(IqPacket.TYPE.ERROR);