aboutsummaryrefslogtreecommitdiff
path: root/juick-www/src/main/java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-10-25 15:42:06 +0300
committerGravatar Vitaly Takmazov2016-10-25 15:42:06 +0300
commit3d45dbab6e927ab88c6730d07c955242612eca53 (patch)
tree38be7796e99ee382fcb070add6227fdf7f9eecef /juick-www/src/main/java
parentd1f27eff90719ed40d0d30d048f00908656b3028 (diff)
www: option to disable xmpp
Diffstat (limited to 'juick-www/src/main/java')
-rw-r--r--juick-www/src/main/java/com/juick/www/Main.java9
1 files changed, 6 insertions, 3 deletions
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"));