summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/connection.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/connection.py b/src/connection.py
index dfc8ba85..0be94097 100644
--- a/src/connection.py
+++ b/src/connection.py
@@ -63,9 +63,11 @@ class Connection(sleekxmpp.ClientXMPP):
# With anon auth.
# (domain, config.get('port', 5222))
custom_host = config.get('custom_host', '')
- custom_port = config.get('custom_port', -1)
- if custom_host and custom_port != -1:
+ custom_port = config.get('custom_port', 5222)
+ if custom_host:
res = self.connect((custom_host, custom_port), reattempt=False)
+ elif custom_port != 5222:
+ res = self.connect((self.boundjid.host, custom_port), reattempt=False)
else:
res = self.connect(reattempt=False)
if not res: