summaryrefslogtreecommitdiff
path: root/sleekxmpp/xmlstream/stanzabase.py
diff options
context:
space:
mode:
Diffstat (limited to 'sleekxmpp/xmlstream/stanzabase.py')
-rw-r--r--sleekxmpp/xmlstream/stanzabase.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/sleekxmpp/xmlstream/stanzabase.py b/sleekxmpp/xmlstream/stanzabase.py
index 480e9602..7a5ba4a1 100644
--- a/sleekxmpp/xmlstream/stanzabase.py
+++ b/sleekxmpp/xmlstream/stanzabase.py
@@ -18,7 +18,10 @@ class JID(object):
if name == 'resource':
return self.jid.split('/', 1)[-1]
elif name == 'user':
- return self.jid.split('@', 1)[0]
+ if '@' in self.jid:
+ return self.jid.split('@', 1)[0]
+ else:
+ return ''
elif name == 'server':
return self.jid.split('@', 1)[-1].split('/', 1)[0]
elif name == 'full':