From be1992ce897d3b0551e545646a3e0f45cc6dd8c2 Mon Sep 17 00:00:00 2001 From: steckbrief Date: Sun, 6 Aug 2017 14:28:00 +0200 Subject: Implements XEP-0202 Entity Time, moves Software Version to xmpp package, moves namespace definitions for mam, carbons and avatar to xmpp package --- .../xmpp/time/TimePacketGenerator.java | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/main/java/de/thedevstack/conversationsplus/xmpp/time/TimePacketGenerator.java (limited to 'src/main/java/de/thedevstack/conversationsplus/xmpp/time/TimePacketGenerator.java') diff --git a/src/main/java/de/thedevstack/conversationsplus/xmpp/time/TimePacketGenerator.java b/src/main/java/de/thedevstack/conversationsplus/xmpp/time/TimePacketGenerator.java new file mode 100644 index 00000000..344beb9e --- /dev/null +++ b/src/main/java/de/thedevstack/conversationsplus/xmpp/time/TimePacketGenerator.java @@ -0,0 +1,38 @@ +package de.thedevstack.conversationsplus.xmpp.time; + +import de.thedevstack.conversationsplus.xmpp.iqversion.IqVersionPacket; +import de.thedevstack.conversationsplus.xmpp.stanzas.IqPacket; + +/** + * Generates the IQ Packets for Entity Time + * as defined in XEP-0202. + * @see http://xmpp.org/extensions/xep-0202.html + */ +public final class TimePacketGenerator { + + /** + * Generates the IqPacket to reply the entity time. + *
+     * 
+     *   
+     * 
+     * 
+ * @param packet + * @return + */ + public static TimePacket generateResponse(IqPacket packet) { + TimePacket timePacket = new TimePacket(); + timePacket.setTo(packet.getFrom()); + timePacket.setId(packet.getId()); + + return timePacket; + } + + private TimePacketGenerator() {} +} -- cgit v1.2.3