From 6bd4e6c5bb43ea077ad678b700a6bde249c8c0c7 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 31 Jan 2018 14:31:23 +0300 Subject: xmpp: set software version --- juick-xmpp-wip/src/main/java/com/juick/components/XMPPBot.java | 8 -------- juick-xmpp/src/main/java/com/juick/components/XMPPConnection.java | 4 ++++ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/juick-xmpp-wip/src/main/java/com/juick/components/XMPPBot.java b/juick-xmpp-wip/src/main/java/com/juick/components/XMPPBot.java index 7cd0cbc0..2e051d32 100644 --- a/juick-xmpp-wip/src/main/java/com/juick/components/XMPPBot.java +++ b/juick-xmpp-wip/src/main/java/com/juick/components/XMPPBot.java @@ -19,8 +19,6 @@ package com.juick.components; import com.juick.User; import com.juick.server.helpers.UserInfo; -import com.juick.server.protocol.JuickProtocol; -import com.juick.server.protocol.ProtocolListener; import com.juick.service.PMQueriesService; import com.juick.service.UserService; import org.apache.commons.io.IOUtils; @@ -34,15 +32,11 @@ import rocks.xmpp.core.stanza.model.Message; import rocks.xmpp.extensions.component.accept.ExternalComponent; import rocks.xmpp.extensions.vcard.temp.VCardManager; import rocks.xmpp.extensions.vcard.temp.model.VCard; -import rocks.xmpp.extensions.version.SoftwareVersionManager; -import rocks.xmpp.extensions.version.model.SoftwareVersion; import javax.annotation.PostConstruct; import javax.inject.Inject; import java.io.IOException; -import java.lang.reflect.InvocationTargetException; import java.net.URL; -import java.util.List; /** * Created by vt on 12/11/2016. @@ -68,8 +62,6 @@ public class XMPPBot implements AutoCloseable { NumberUtils.toInt(env.getProperty("component_port", "5347"), 5347)); juickJid = Jid.of(env.getProperty("xmppbot_jid", "juick@juick.com/Juick")); try { - SoftwareVersionManager softwareVersionManager = component.getManager(SoftwareVersionManager.class); - softwareVersionManager.setSoftwareVersion(new SoftwareVersion("Juick", "git", System.getProperty("os.name", "generic"))); VCardManager vCardManager = component.getManager(VCardManager.class); vCardManager.setEnabled(true); VCard ownVCard = new VCard(); diff --git a/juick-xmpp/src/main/java/com/juick/components/XMPPConnection.java b/juick-xmpp/src/main/java/com/juick/components/XMPPConnection.java index b515ac1c..6bca282c 100644 --- a/juick-xmpp/src/main/java/com/juick/components/XMPPConnection.java +++ b/juick-xmpp/src/main/java/com/juick/components/XMPPConnection.java @@ -49,6 +49,8 @@ import rocks.xmpp.extensions.nick.model.Nickname; import rocks.xmpp.extensions.oob.model.x.OobX; import rocks.xmpp.extensions.ping.PingManager; import rocks.xmpp.extensions.vcard.temp.model.VCard; +import rocks.xmpp.extensions.version.SoftwareVersionManager; +import rocks.xmpp.extensions.version.model.SoftwareVersion; import rocks.xmpp.util.XmppUtils; import javax.annotation.PostConstruct; @@ -108,6 +110,8 @@ public class XMPPConnection implements AutoCloseable { PingManager pingManager = router.getManager(PingManager.class); pingManager.setEnabled(true); router.disableFeature(EntityCapabilities.NAMESPACE); + SoftwareVersionManager softwareVersionManager = router.getManager(SoftwareVersionManager.class); + softwareVersionManager.setSoftwareVersion(new SoftwareVersion("Juick", "2.x", System.getProperty("os.name", "generic"))); VCard vCard = new VCard(); vCard.setFormattedName("Juick"); try { -- cgit v1.2.3