From a85973603a137a2866bb434e4276844425d3cb77 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sun, 31 Jul 2016 20:25:26 +0300 Subject: www: read component jid from config --- juick-www/src/main/java/com/juick/www/Main.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'juick-www/src/main/java') 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) { -- cgit v1.2.3