diff options
author | steckbrief <steckbrief@chefmail.de> | 2017-08-06 14:28:00 +0200 |
---|---|---|
committer | steckbrief <steckbrief@chefmail.de> | 2017-08-06 14:28:00 +0200 |
commit | be1992ce897d3b0551e545646a3e0f45cc6dd8c2 (patch) | |
tree | c15c94ade61e5063095d8b429ae4acf85459493f /src/main/java/de/thedevstack/conversationsplus/xmpp/iqversion/IqVersionPacketGenerator.java | |
parent | f8e083a32cb7232c9601f5011b14738d43bb3b06 (diff) |
Implements XEP-0202 Entity Time, moves Software Version to xmpp package, moves namespace definitions for mam, carbons and avatar to xmpp package
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/xmpp/iqversion/IqVersionPacketGenerator.java')
-rw-r--r-- | src/main/java/de/thedevstack/conversationsplus/xmpp/iqversion/IqVersionPacketGenerator.java | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/xmpp/iqversion/IqVersionPacketGenerator.java b/src/main/java/de/thedevstack/conversationsplus/xmpp/iqversion/IqVersionPacketGenerator.java new file mode 100644 index 00000000..97a7e90d --- /dev/null +++ b/src/main/java/de/thedevstack/conversationsplus/xmpp/iqversion/IqVersionPacketGenerator.java @@ -0,0 +1,38 @@ +package de.thedevstack.conversationsplus.xmpp.iqversion; + +import de.thedevstack.conversationsplus.xmpp.stanzas.IqPacket; + +/** + * Generates the IQ Packets for Software Version + * as defined in XEP-0092. + * @see <a href="http://xmpp.org/extensions/xep-0092.html">http://xmpp.org/extensions/xep-0092.html</a> + */ +public final class IqVersionPacketGenerator { + + /** + * Generates the IqPacket to reply the software version. + * <pre> + * <iq from='juliet@capulet.com/balcony' + * type='result' + * to='romeo@montague.net/orchard' + * id='version_1'> + * <query xmlns='jabber:iq:version'> + * <name>Exodus</name> + * <version>0.7.0.4</version> + * <os>Windows-XP 5.01.2600</os> + * </query> + * </iq> + * </pre> + * @param packet the packet to respond to + * @return + */ + public static IqVersionPacket generateResponse(IqPacket packet) { + IqVersionPacket iqVersionPacket = new IqVersionPacket(); + iqVersionPacket.setTo(packet.getFrom()); + iqVersionPacket.setId(packet.getId()); + + return iqVersionPacket; + } + + private IqVersionPacketGenerator() {} +} |