summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne@collabora.co.uk>2010-10-05 11:44:34 -0400
committerLouis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne@collabora.co.uk>2010-10-21 10:55:14 -0400
commit60b1c710a70d282e20d70e6898e9664011b1afc8 (patch)
treec4fe7d4fcb196b2d3fe094c4c9b4897dbdf349cb
parent13e938c649b47f3c4126295f0d7f587475442210 (diff)
bugfix: don't send invalid ADL when a contact is on both Allow and Block list
-rw-r--r--papyon/msnp/notification.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/papyon/msnp/notification.py b/papyon/msnp/notification.py
index 3b0284a..3c7ce3c 100644
--- a/papyon/msnp/notification.py
+++ b/papyon/msnp/notification.py
@@ -733,9 +733,16 @@ class NotificationProtocol(BaseProtocol, gobject.GObject):
address_book.profile.display_name)
contacts = address_book.contacts.group_by_domain()
+ mask = ~(profile.Membership.REVERSE | profile.Membership.PENDING)
+
+ for contact in address_book.contacts:
+ if (contact.memberships & mask & ~profile.Membership.FORWARD) == \
+ (profile.Membership.ALLOW | profile.Membership.BLOCK):
+ logger.warning("Contact is on both Allow and Block list; " \
+ "removing from Allow list (%s)" % contact.account)
+ contact._remove_membership(profile.Membership.ALLOW)
payloads = ['<ml l="1">']
- mask = ~(profile.Membership.REVERSE | profile.Membership.PENDING)
for domain, contacts in contacts.iteritems():
payloads[-1] += '<d n="%s">' % domain
for contact in contacts: