aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/xmpp
diff options
context:
space:
mode:
authorChristian S <christian@pix-art.de>2016-04-21 21:25:34 +0200
committerChristian S <christian@pix-art.de>2016-04-21 21:25:34 +0200
commit1ecb3befed4f726f9334947306773c20c3cd9afa (patch)
tree0a2a9586d5f3658a585825c5d8a561b9568549d0 /src/main/java/eu/siacs/conversations/xmpp
parenta277d7edd596945e056f7366fdf0f13019fb60e8 (diff)
use IP/port to connect to server
Diffstat (limited to 'src/main/java/eu/siacs/conversations/xmpp')
-rw-r--r--src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
index 4dc5492e3..afae7b3a7 100644
--- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
+++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
@@ -254,7 +254,17 @@ public class XmppConnection implements Runnable {
this.changeStatus(Account.State.CONNECTING);
final boolean useTor = mXmppConnectionService.useTorToConnect() || account.isOnion();
final boolean extended = mXmppConnectionService.showExtendedConnectionOptions();
- if (useTor) {
+ if (Config.XMPP_IP != null && Config.XMPP_Port != null) {
+ socket = new Socket();
+ try {
+ socket.connect(new InetSocketAddress(Config.XMPP_IP, Config.XMPP_Port), Config.SOCKET_TIMEOUT * 1000);
+ } catch (IOException e) {
+ throw new UnknownHostException();
+ }
+ Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": connect to " + Config.XMPP_IP + ":" + Config.XMPP_Port);
+ startXmpp();
+ }
+ else if (useTor) {
String destination;
if (account.getHostname() == null || account.getHostname().isEmpty()) {
destination = account.getServer().toString();