summaryrefslogtreecommitdiff
path: root/src/connection.py
diff options
context:
space:
mode:
authorlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-10-16 18:47:39 +0000
committerlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-10-16 18:47:39 +0000
commitdb27041571b6c4b2cf9b7a9567702d8dacba5e74 (patch)
tree760b303da16346f9b4845c2a00b3fdf3f8c98bab /src/connection.py
parent3a66bc99e3ce3a21bbfe49b6308534cca4904877 (diff)
downloadpoezio-db27041571b6c4b2cf9b7a9567702d8dacba5e74.tar.gz
poezio-db27041571b6c4b2cf9b7a9567702d8dacba5e74.tar.bz2
poezio-db27041571b6c4b2cf9b7a9567702d8dacba5e74.tar.xz
poezio-db27041571b6c4b2cf9b7a9567702d8dacba5e74.zip
remove the warnings caused by the new version of sleekxmpp, and update the connection method (changed also in sleek)
Diffstat (limited to 'src/connection.py')
-rw-r--r--src/connection.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/connection.py b/src/connection.py
index e284d82b..ae480e22 100644
--- a/src/connection.py
+++ b/src/connection.py
@@ -27,7 +27,6 @@ import sleekxmpp
from config import config
from logger import logger
from handler import Handler
-from common import jid_get_node, jid_get_domain, is_jid_the_same
class Connection(sleekxmpp.ClientXMPP):
"""
@@ -35,23 +34,21 @@ class Connection(sleekxmpp.ClientXMPP):
appropriate signals
"""
def __init__(self):
+ resource = config.get('resource', '')
if config.get('jid', ''):
self.anon = False # Field used to know if we are anonymous or not.
# many features will be handled diferently
# depending on this setting
- jid = config.get('jid', '')
+ jid = '%s/%s' % (config.get('jid', ''), resource)
password = config.get('password', '')
- else: # anonymous auth
+ else: # anonymous auth
self.anon = True
- jid = None
+ jid = '%s/%s' % (config.get('server', 'anon.louiz.org'), resource)
password = None
- sleekxmpp.ClientXMPP.__init__(self, jid, password, ssl=True,
- resource=config.get('resource', 'poezio'))
-
+ sleekxmpp.ClientXMPP.__init__(self, jid, password, ssl=True)
self.registerPlugin('xep_0045')
def start(self):
# TODO, try multiple servers
- if self.connect((config.get('server', 'anon.louiz.org'),
- config.get('port', 5222))):
+ if self.connect((config.get('server', 'anon.louiz.org'), config.get('port', 5222))):
self.process(threaded=True)