Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def disallow_contact(self, contact, done_cb=None, failed_cb=None):
def callback(memberships):
contact._remove_membership(Membership.ALLOW)
self.__common_callback('contact-disallowed', done_cb, contact)
if contact.memberships == Membership.NONE:
self.contacts.discard(contact)
dc = scenario.DisallowContactScenario(self._sharing,
(callback,),
(self.__common_errback, failed_cb))
dc.account = contact.account
dc.network = contact.network_id
dc.membership = contact.memberships
dc()
def disallow_contact(self, contact, done_cb=None, failed_cb=None):
def callback(memberships):
contact._remove_membership(Membership.ALLOW)
self.__common_callback('contact-disallowed', done_cb, contact)
if contact.memberships == Membership.NONE:
self.contacts.discard(contact)
dc = scenario.DisallowContactScenario(self._sharing,
(callback,),
(self.__common_errback, failed_cb))
dc.account = contact.account
dc.network = contact.network_id
dc.membership = contact.memberships
dc()
def disallow_contact(self, contact, done_cb=None, failed_cb=None):
def callback(memberships):
contact._remove_membership(Membership.ALLOW)
self.__common_callback('contact-disallowed', done_cb, contact)
if contact.memberships == Membership.NONE:
self.contacts.discard(contact)
dc = scenario.DisallowContactScenario(self._sharing,
(callback,),
(self.__common_errback, failed_cb))
dc.account = contact.account
dc.network = contact.network_id
dc.membership = contact.memberships
dc()