summaryrefslogtreecommitdiff
path: root/sleekxmpp/xmlstream/jid.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2011-01-05 20:16:15 -0500
committerLance Stout <lancestout@gmail.com>2011-01-05 20:16:15 -0500
commit2908751020b61da5466ff15644628e29bd5bbd3a (patch)
treeb911dd78b3e17d2c73818d939bba93259cac2605 /sleekxmpp/xmlstream/jid.py
parent8b29431cdeff5647208e3eab108bba9e9c8318fc (diff)
downloadslixmpp-2908751020b61da5466ff15644628e29bd5bbd3a.tar.gz
slixmpp-2908751020b61da5466ff15644628e29bd5bbd3a.tar.bz2
slixmpp-2908751020b61da5466ff15644628e29bd5bbd3a.tar.xz
slixmpp-2908751020b61da5466ff15644628e29bd5bbd3a.zip
Allow JID objects to be compared with strings.
Two JIDs match if they have the same full JID value.
Diffstat (limited to 'sleekxmpp/xmlstream/jid.py')
-rw-r--r--sleekxmpp/xmlstream/jid.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/sleekxmpp/xmlstream/jid.py b/sleekxmpp/xmlstream/jid.py
index d8f45b92..e5c49dc0 100644
--- a/sleekxmpp/xmlstream/jid.py
+++ b/sleekxmpp/xmlstream/jid.py
@@ -124,3 +124,9 @@ class JID(object):
def __repr__(self):
return str(self)
+
+ def __eq__(self, other):
+ """
+ Two JIDs are considered equal if they have the same full JID value.
+ """
+ return str(other) == str(self)