package de.thedevstack.conversationsplus.xmpp.pubsub; import de.thedevstack.conversationsplus.xml.Element; import de.thedevstack.conversationsplus.xmpp.stanzas.IqPacket; /** * Created by tzur on 15.01.2016. */ public class PubSubPacketParser { public static Element findPubSubPacket(IqPacket packet){ if (null == packet) { return null; } return packet.findChild("pubsub", "http://jabber.org/protocol/pubsub"); } public static Element findItemsFromPubSubElement(Element pubSubPacket) { if (null == pubSubPacket) { return null; } return pubSubPacket.findChild("items"); } public static Element findItems(IqPacket packet) { return PubSubPacketParser.findItemsFromPubSubElement(PubSubPacketParser.findPubSubPacket(packet)); } }