From 1bf61cde38dc67945f12882aeffa6e3a67229f5e Mon Sep 17 00:00:00 2001 From: mathieui Date: Mon, 21 Jan 2013 19:23:23 +0100 Subject: 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 --- src/contact.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/contact.py') 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. -- cgit v1.2.3