summaryrefslogtreecommitdiff
path: root/slixmpp/jid.py
diff options
context:
space:
mode:
Diffstat (limited to 'slixmpp/jid.py')
-rw-r--r--slixmpp/jid.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/slixmpp/jid.py b/slixmpp/jid.py
index 2e23e242..337aca2a 100644
--- a/slixmpp/jid.py
+++ b/slixmpp/jid.py
@@ -208,16 +208,15 @@ def _format_jid(local=None, domain=None, resource=None):
:return: A full or bare JID string.
"""
- result = []
+ if domain is None:
+ return ''
if local is not None:
- result.append(local)
- result.append('@')
- if domain is not None:
- result.append(domain)
+ result = local + '@' + domain
+ else:
+ result = domain
if resource is not None:
- result.append('/')
- result.append(resource)
- return ''.join(result)
+ result += '/' + resource
+ return result
class InvalidJID(ValueError):