From 2908751020b61da5466ff15644628e29bd5bbd3a Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Wed, 5 Jan 2011 20:16:15 -0500 Subject: Allow JID objects to be compared with strings. Two JIDs match if they have the same full JID value. --- sleekxmpp/xmlstream/jid.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sleekxmpp/xmlstream/jid.py') 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) -- cgit v1.2.3