diff options
author | Lance Stout <lancestout@gmail.com> | 2011-05-20 21:41:44 -0400 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2011-05-20 21:41:44 -0400 |
commit | 9851a2a057aeee54300f703a39507713e7ad199a (patch) | |
tree | 76056226ae21cef996b24da69534abfa08249d29 /sleekxmpp/xmlstream | |
parent | a269be485f2918b332c9fa3717541fc0c6c954c2 (diff) | |
parent | 7152d93dd05346fdb7dbe1893bff6395f83a79a9 (diff) | |
download | slixmpp-9851a2a057aeee54300f703a39507713e7ad199a.tar.gz slixmpp-9851a2a057aeee54300f703a39507713e7ad199a.tar.bz2 slixmpp-9851a2a057aeee54300f703a39507713e7ad199a.tar.xz slixmpp-9851a2a057aeee54300f703a39507713e7ad199a.zip |
Merge branch 'develop' into stream_features
Diffstat (limited to 'sleekxmpp/xmlstream')
-rw-r--r-- | sleekxmpp/xmlstream/jid.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sleekxmpp/xmlstream/jid.py b/sleekxmpp/xmlstream/jid.py index 5019a25e..36b33056 100644 --- a/sleekxmpp/xmlstream/jid.py +++ b/sleekxmpp/xmlstream/jid.py @@ -6,6 +6,8 @@ See the file LICENSE for copying permission. """ +from __future__ import unicode_literals + class JID(object): """ @@ -42,7 +44,9 @@ class JID(object): Arguments: jid - The new JID value. """ - self._full = self._jid = str(jid) + if isinstance(jid, JID): + jid = jid.full + self._full = self._jid = jid self._domain = None self._resource = None self._user = None @@ -123,10 +127,11 @@ class JID(object): return self.full def __repr__(self): - return str(self) + return self.full def __eq__(self, other): """ Two JIDs are considered equal if they have the same full JID value. """ - return str(other) == str(self) + other = JID(other) + return self.full == other.full |