package de.thedevstack.conversationsplus.xmpp.pubsub; import eu.siacs.conversations.xml.Element; import eu.siacs.conversations.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)); } }