summaryrefslogtreecommitdiff
path: root/src/connection.py
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2014-07-24 15:19:26 +0200
committerFlorent Le Coz <louiz@louiz.org>2014-07-24 15:19:26 +0200
commitc166e79a896eba0299f16f6f727febd225e62100 (patch)
treef4c7bd971cbe3598cc270d8b32b1e491cf20c3b7 /src/connection.py
parent9c3fece96bee3c381cf0d7bd7022b46c858c6e1b (diff)
downloadpoezio-c166e79a896eba0299f16f6f727febd225e62100.tar.gz
poezio-c166e79a896eba0299f16f6f727febd225e62100.tar.bz2
poezio-c166e79a896eba0299f16f6f727febd225e62100.tar.xz
poezio-c166e79a896eba0299f16f6f727febd225e62100.zip
First adaptation to slixmpp
Diffstat (limited to 'src/connection.py')
-rw-r--r--src/connection.py18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/connection.py b/src/connection.py
index be55a90f..fafbff69 100644
--- a/src/connection.py
+++ b/src/connection.py
@@ -133,6 +133,7 @@ class Connection(slixmpp.ClientXMPP):
self.register_plugin('xep_0280')
self.register_plugin('xep_0297')
self.register_plugin('xep_0308')
+ self.init_plugins()
def set_keepalive_values(self, option=None, value=None):
"""
@@ -158,32 +159,25 @@ class Connection(slixmpp.ClientXMPP):
def start(self):
"""
Connect and process events.
-
- TODO: try multiple servers with anon auth.
"""
custom_host = config.get('custom_host', '')
custom_port = config.get('custom_port', 5222)
if custom_port == -1:
custom_port = 5222
if custom_host:
- res = self.connect((custom_host, custom_port), reattempt=True)
+ self.connect((custom_host, custom_port))
elif custom_port != 5222 and custom_port != -1:
- res = self.connect((self.boundjid.host, custom_port),
- reattempt=True)
+ self.connect((self.boundjid.host, custom_port))
else:
- res = self.connect(reattempt=True)
- if not res:
- return False
- self.process(threaded=True)
- return True
+ self.connect()
- def send_raw(self, data, now=False, reconnect=None):
+ def send_raw(self, data):
"""
Overrides XMLStream.send_raw, with an event added
"""
if self.core:
self.core.outgoing_stanza(data)
- slixmpp.ClientXMPP.send_raw(self, data, now, reconnect)
+ slixmpp.ClientXMPP.send_raw(self, data)
class MatchAll(slixmpp.xmlstream.matcher.base.MatcherBase):
"""