From 0cb39b32a4ee3a2f86f6db6d2354836bcf68a33e Mon Sep 17 00:00:00 2001 From: mathieui Date: Wed, 1 Aug 2012 20:10:00 +0200 Subject: Do not generate invalid jids (e.g. localpart@domainpart/) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is in prevision of a sleekxmpp update with JID validation. Also, comment the “server” option in the config file a bit better. --- src/contact.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/contact.py') 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): -- cgit v1.2.3