diff options
| author | Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne@collabora.co.uk> | 2010-10-05 11:44:34 -0400 |
|---|---|---|
| committer | Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne@collabora.co.uk> | 2010-10-21 09:52:11 -0400 |
| commit | 991500a6d4c0c86e39738cf233a136c2a60e2951 (patch) | |
| tree | 0d2dc01821b3f90e566017ef7dd972aa0bd675e2 | |
| parent | 5c66141c21a012a01d1e77cc11c0623408e3c3e7 (diff) | |
bugfix: don't send invalid ADL when a contact is on both Allow and Block list
| -rw-r--r-- | papyon/msnp/notification.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/papyon/msnp/notification.py b/papyon/msnp/notification.py index 83e7fce..0203c1a 100644 --- a/papyon/msnp/notification.py +++ b/papyon/msnp/notification.py @@ -768,9 +768,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: |
