aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/juick/ws/XMPPConnection.java7
-rw-r--r--src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java2
2 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/com/juick/ws/XMPPConnection.java b/src/main/java/com/juick/ws/XMPPConnection.java
index 5d4fbce9..802271a0 100644
--- a/src/main/java/com/juick/ws/XMPPConnection.java
+++ b/src/main/java/com/juick/ws/XMPPConnection.java
@@ -8,6 +8,7 @@ import com.juick.xmpp.Message;
import com.juick.xmpp.Stream;
import com.juick.xmpp.StreamComponent;
import com.juick.xmpp.extensions.JuickMessage;
+import org.springframework.core.env.Environment;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import org.springframework.web.socket.TextMessage;
@@ -30,14 +31,16 @@ public class XMPPConnection implements Runnable, Stream.StreamListener, Message.
@Inject
JdbcTemplate sql;
+ @Inject
+ Environment env;
Stream xmpp;
String xmppPassword;
MessageSerializer ms;
@Inject
WebsocketComponent ws;
- public XMPPConnection(String password) {
- xmppPassword = password;
+ public XMPPConnection() {
+ xmppPassword = env.getProperty("xmpp_password");
ms = new MessageSerializer();
new Thread(this).start();
}
diff --git a/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java b/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java
index 9fd75bb0..46ef8486 100644
--- a/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java
+++ b/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java
@@ -43,7 +43,7 @@ public class WebsocketConfiguration extends WebMvcConfigurerAdapter implements W
}
@Bean
XMPPConnection xmpp() {
- return new XMPPConnection(env.getProperty("xmpp_password"));
+ return new XMPPConnection();
}
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {