package de.thedevstack.conversationsplus.xmpp.iqversion; import de.thedevstack.conversationsplus.entities.Account; import de.thedevstack.conversationsplus.utils.XmppSendUtil; import de.thedevstack.conversationsplus.xmpp.IqPacketHandler; import de.thedevstack.conversationsplus.xmpp.exceptions.IqPacketErrorException; import de.thedevstack.conversationsplus.xmpp.exceptions.NotAllowedIqException; import de.thedevstack.conversationsplus.xmpp.stanzas.IqPacket; /** */ public class IqVersionPacketHandler implements IqPacketHandler { @Override public void handleIqPacket(Account account, IqPacket packet) throws IqPacketErrorException { if (packet.getType() == IqPacket.TYPE.GET) { XmppSendUtil.sendIqPacket(account, IqVersionPacketGenerator.generateResponse(packet)); } else { throw new NotAllowedIqException(packet, "only type=get allowed for processing an Software Version (XEP-0092)"); } } }