summaryrefslogtreecommitdiff
path: root/src/contact.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2013-01-21 19:23:23 +0100
committermathieui <mathieui@mathieui.net>2013-01-21 19:23:23 +0100
commit1bf61cde38dc67945f12882aeffa6e3a67229f5e (patch)
tree7cfbe7197bf326e11d8cbdab625b277b8acd7f58 /src/contact.py
parentbedf22574934fa569e3c6fcd487033366c7408e4 (diff)
downloadpoezio-1bf61cde38dc67945f12882aeffa6e3a67229f5e.tar.gz
poezio-1bf61cde38dc67945f12882aeffa6e3a67229f5e.tar.bz2
poezio-1bf61cde38dc67945f12882aeffa6e3a67229f5e.tar.xz
poezio-1bf61cde38dc67945f12882aeffa6e3a67229f5e.zip
Break the ugly roster refresh loop into two
- The code is more understandable - The number of iterations may have slightly increased - Less things are done inside the lock, so the overall experience should be smoother
Diffstat (limited to 'src/contact.py')
-rw-r--r--src/contact.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/contact.py b/src/contact.py
index 0d7276f9..62092057 100644
--- a/src/contact.py
+++ b/src/contact.py
@@ -47,6 +47,11 @@ class Resource(object):
def __repr__(self):
return '<%s>' % self._jid
+ def __eq__(self, value):
+ if not isinstance(value, Resource):
+ return False
+ return self.jid == value.jid and self._data == value._data
+
class Contact(object):
"""
This a way to gather multiple resources from the same bare JID.