summaryrefslogtreecommitdiff
path: root/src/connection.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/connection.py')
-rw-r--r--src/connection.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/connection.py b/src/connection.py
index 30e0b552..b712004b 100644
--- a/src/connection.py
+++ b/src/connection.py
@@ -21,6 +21,7 @@ import sleekxmpp
from config import config, options
from logger import logger
import common
+from common import safeJID
class Connection(sleekxmpp.ClientXMPP):
"""
@@ -40,8 +41,11 @@ class Connection(sleekxmpp.ClientXMPP):
password = config.get('password', '') or getpass.getpass()
else: # anonymous auth
self.anon = True
- jid = '%s/%s' % (config.get('server', 'anon.louiz.org'), resource)
+ jid = config.get('server', 'anon.louiz.org')
+ if resource:
+ jid = '%s/%s' % (jid, resource)
password = None
+ jid = safeJID(jid)
sleekxmpp.ClientXMPP.__init__(self, jid, password)
self.core = None
self.auto_reconnect = True if config.get('auto_reconnect', 'false').lower() in ('true', '1') else False