aboutsummaryrefslogtreecommitdiff
path: root/juick-www
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-07-31 20:25:26 +0300
committerGravatar Vitaly Takmazov2016-07-31 20:25:26 +0300
commita85973603a137a2866bb434e4276844425d3cb77 (patch)
treecb425e0fb4dde10768eb93418496179c746e4e78 /juick-www
parentd06d53708a1f87d41b14fc87d40a7b9233b36fcb (diff)
www: read component jid from config
Diffstat (limited to 'juick-www')
-rw-r--r--juick-www/src/main/java/com/juick/www/Main.java6
1 files changed, 3 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 56b886c9..e3457323 100644
--- a/juick-www/src/main/java/com/juick/www/Main.java
+++ b/juick-www/src/main/java/com/juick/www/Main.java
@@ -82,7 +82,7 @@ public class Main extends HttpServlet implements Stream.StreamListener {
sql = new JdbcTemplate(dataSource);
sqlSearch = new JdbcTemplate(dataSourceSearch);
- setupXmppComponent(conf.getProperty("xmpp_password"));
+ setupXmppComponent(new JID(conf.getProperty("www_xmpp_jid", "www.juick.local")), conf.getProperty("xmpp_password"));
twitterAuth = new TwitterAuth(conf.getProperty("twitter_consumer_key"),
conf.getProperty("twitter_consumer_secret"));
pagesNewMessage = new NewMessage(conf.getProperty("upload_tmp_dir", "/var/www/juick.com/i/tmp/"),
@@ -98,11 +98,11 @@ public class Main extends HttpServlet implements Stream.StreamListener {
}
}
- public void setupXmppComponent(final String password) {
+ public void setupXmppComponent(final JID componentJid, final String password) {
Thread thr = new Thread(() -> {
try {
Socket socket = new Socket("localhost", 5347);
- xmpp = new StreamComponent(new JID("", "www.juick.com", ""), socket.getInputStream(), socket.getOutputStream(), password);
+ xmpp = new StreamComponent(componentJid, socket.getInputStream(), socket.getOutputStream(), password);
xmpp.addListener(Main.this);
xmpp.startParsing();
} catch (IOException e) {