~olethanh/telepathy-butterfly/simple-presence

« back to all changes in this revision

Viewing changes to butterfly/channel/group.py

  • Committer: Ali Sabil
  • Date: 2008-01-12 21:29:09 UTC
  • Revision ID: ali.sabil@gmail.com-20080112212909-h4dxs0f2xyn5whny
- Fixed adding contacts to group during contact addition

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
                        (contact_handle, self._handle))
72
72
                contact = contact_handle.contact
73
73
                group = self._handle.group
74
 
                ab.add_contact_to_group(group, contact)
 
74
                if contact is not None and contact.is_member(pymsn.Membership.FORWARD):
 
75
                    ab.add_contact_to_group(group, contact)
 
76
                else:
 
77
                    contact_handle.pending_groups.add(group)
75
78
 
76
79
    def RemoveMembers(self, contacts, message):
77
80
        ab = self._conn.msn_client.address_book
94
97
                        (contact_handle, self._handle))
95
98
                contact = contact_handle.contact
96
99
                group = self._handle.group
97
 
                ab.delete_contact_from_group(group, contact)
 
100
                if contact is not None and contact.is_member(pymsn.Membership.FORWARD):
 
101
                    ab.delete_contact_from_group(group, contact)
 
102
                else:
 
103
                    contact_handle.pending_groups.discard(group)
98
104
 
99
105
    def Close(self):
100
106
        logger.debug("Deleting group %s" % self._handle.name)