diff options
author | louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13> | 2010-11-08 01:33:36 +0000 |
---|---|---|
committer | louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13> | 2010-11-08 01:33:36 +0000 |
commit | df6d2fc2d3aa8b6ea396e96acddf6b695ec35197 (patch) | |
tree | 6644e00998898841a5c8fe294e0de5b458fbabd9 /src | |
parent | 38e290fdefc9f1e1e2d1cff6c0fa8652ccf3c719 (diff) | |
download | poezio-df6d2fc2d3aa8b6ea396e96acddf6b695ec35197.tar.gz poezio-df6d2fc2d3aa8b6ea396e96acddf6b695ec35197.tar.bz2 poezio-df6d2fc2d3aa8b6ea396e96acddf6b695ec35197.tar.xz poezio-df6d2fc2d3aa8b6ea396e96acddf6b695ec35197.zip |
use custom_port and custom_host if advanced configuration is needed. Else it will use SRV DNS resolution if dnspython is installed
Diffstat (limited to 'src')
-rw-r--r-- | src/connection.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/connection.py b/src/connection.py index 5432a823..2e74e4e1 100644 --- a/src/connection.py +++ b/src/connection.py @@ -50,9 +50,11 @@ class Connection(sleekxmpp.ClientXMPP): def start(self): # TODO, try multiple servers - if self.anon: - domain = config.get('server', 'anon.louiz.org') + # (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: + self.connect((custom_host, custom_port)) else: - _, domain = config.get('jid', '').split('@', 1) - if self.connect((domain, config.get('port', 5222))): - self.process(threaded=True) + self.connect() + self.process(threaded=True) |