[telepathy-butterfly/master] Deleted contacts can still be members of allow or block lists

Louis-Francis Ratté-Boulianne louis-francis.ratte-boulianne at collabora.co.uk
Tue Aug 4 14:27:06 PDT 2009


---
 butterfly/channel/contact_list.py |    3 ++-
 butterfly/channel/group.py        |    7 ++++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/butterfly/channel/contact_list.py b/butterfly/channel/contact_list.py
index 8e3852a..010654e 100644
--- a/butterfly/channel/contact_list.py
+++ b/butterfly/channel/contact_list.py
@@ -151,7 +151,8 @@ class ButterflyListChannel(
     def on_addressbook_contact_deleted(self, contact):
         handle = ButterflyHandleFactory(self._conn_ref(), 'contact',
                 contact.account, contact.network_id)
-        if self._contains_handle(handle):
+        ad, lp, rp = self._filter_contact(contact)
+        if self._contains_handle(handle) and not ad:
             self.MembersChanged('', (), [handle], (), (), 0,
                     telepathy.CHANNEL_GROUP_CHANGE_REASON_NONE)
 
diff --git a/butterfly/channel/group.py b/butterfly/channel/group.py
index efd03b8..1a898c2 100644
--- a/butterfly/channel/group.py
+++ b/butterfly/channel/group.py
@@ -109,9 +109,10 @@ class ButterflyGroupChannel(ButterflyListChannel,
         ab.delete_group(group)
 
     def _filter_contact(self, contact):
-        for group in contact.groups:
-            if group.name == self._handle.name:
-                return (True, False, False)
+        if contact.is_member(papyon.Membership.FORWARD):
+            for group in contact.groups:
+                if group.name == self._handle.name:
+                    return (True, False, False)
         return (False, False, False)
 
     def on_addressbook_group_added(self, group):
-- 
1.5.6.5




More information about the telepathy-commits mailing list