summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2011-11-10 17:20:25 +0100
committermathieui <mathieui@mathieui.net>2011-11-10 17:20:25 +0100
commit80edd248ecbf1d983c796c6436c80e9e8c6726e9 (patch)
treea78fa7efbe3269060a9af117319b04daa6145d35
parentbd2d1caa0ab8f83500633d011b8c01b4213484fc (diff)
downloadpoezio-80edd248ecbf1d983c796c6436c80e9e8c6726e9.tar.gz
poezio-80edd248ecbf1d983c796c6436c80e9e8c6726e9.tar.bz2
poezio-80edd248ecbf1d983c796c6436c80e9e8c6726e9.tar.xz
poezio-80edd248ecbf1d983c796c6436c80e9e8c6726e9.zip
Make custom_host and custom_port work better
-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: