summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/connection.py4
-rw-r--r--src/contact.py6
2 files changed, 7 insertions, 3 deletions
diff --git a/src/connection.py b/src/connection.py
index 80c41ee8..f4db0816 100644
--- a/src/connection.py
+++ b/src/connection.py
@@ -34,7 +34,9 @@ class Connection(sleekxmpp.ClientXMPP):
self.anon = False # Field used to know if we are anonymous or not.
# many features will be handled diferently
# depending on this setting
- jid = '%s/%s' % (config.get('jid', ''), resource)
+ jid = '%s' % config.get('jid', '')
+ if resource:
+ jid = '%s/%s' (jid, resource)
password = config.get('password', '') or getpass.getpass()
else: # anonymous auth
self.anon = True
diff --git a/src/contact.py b/src/contact.py
index 3a8e38ab..b8963a71 100644
--- a/src/contact.py
+++ b/src/contact.py
@@ -100,8 +100,10 @@ class Contact(object):
@property
def resources(self):
"""List of the available resources as Resource objects"""
- return [Resource('%s/%s' % (self.bare_jid, key), self.__item.resources[key])
- for key in self.__item.resources]
+ return [Resource(
+ '%s%s' % (self.bare_jid, ('/' + key) if key else ''),
+ self.__item.resources[key]
+ ) for key in self.__item.resources.keys()]
@property
def subscription(self):