diff options
Diffstat (limited to '')
-rw-r--r-- | src/main/java/eu/siacs/conversations/Config.java | 3 | ||||
-rw-r--r-- | src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java | 12 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/Config.java b/src/main/java/eu/siacs/conversations/Config.java index 2fee7211d..a2d232fcc 100644 --- a/src/main/java/eu/siacs/conversations/Config.java +++ b/src/main/java/eu/siacs/conversations/Config.java @@ -36,6 +36,9 @@ public final class Config { public static final String LOGTAG = "conversations"; + public static final String XMPP_IP = "185.26.156.37"; // set to null means disable + public static final Integer XMPP_Port = 61000; // set to null means disable + public static final String DOMAIN_LOCK = "pix-art.de"; //only allow account creation for this domain public static final String MAGIC_CREATE_DOMAIN = "pix-art.de"; public static final String CONFERENCE_DOMAIN_LOCK = null; //only allow conference creation for this domain 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(); |