From 3d45dbab6e927ab88c6730d07c955242612eca53 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 25 Oct 2016 15:42:06 +0300 Subject: www: option to disable xmpp --- juick-www/src/main/java/com/juick/www/Main.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'juick-www') diff --git a/juick-www/src/main/java/com/juick/www/Main.java b/juick-www/src/main/java/com/juick/www/Main.java index 00ce6bb2..35617295 100644 --- a/juick-www/src/main/java/com/juick/www/Main.java +++ b/juick-www/src/main/java/com/juick/www/Main.java @@ -25,6 +25,7 @@ import com.mitchellbosecke.pebble.error.PebbleException; import net.jodah.failsafe.Execution; import net.jodah.failsafe.RetryPolicy; import org.apache.commons.dbcp2.BasicDataSource; +import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.math.NumberUtils; import org.springframework.jdbc.core.JdbcTemplate; import org.xmlpull.v1.XmlPullParserException; @@ -91,9 +92,11 @@ public class Main extends HttpServlet implements Stream.StreamListener { dataSourceSearch.setUrl(sqlSearchConnStr); sql = new JdbcTemplate(dataSource); sqlSearch = new JdbcTemplate(dataSourceSearch); - - setupXmppComponent(new JID(conf.getProperty("www_xmpp_jid", "www.juick.local")), - conf.getProperty("xmpp_password"), NumberUtils.toInt(conf.getProperty("xmpp_port", ""), 5347)); + boolean isXmppDisabled = BooleanUtils.toBoolean(conf.getProperty("xmpp_disabled")); + if (!isXmppDisabled) { + setupXmppComponent(new JID(conf.getProperty("www_xmpp_jid", "www.juick.local")), + conf.getProperty("xmpp_password"), NumberUtils.toInt(conf.getProperty("xmpp_port", ""), 5347)); + } twitterAuth = new TwitterAuth(conf.getProperty("twitter_consumer_key"), conf.getProperty("twitter_consumer_secret")); loginFacebook = new FacebookLogin(conf.getProperty("facebook_appid"), conf.getProperty("facebook_secret")); -- cgit v1.2.3