Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def delete_contact(self, contact):
def callback():
self.contacts.discard(contact)
self.emit('contact-deleted', contact)
dc = scenario.ContactDeleteScenario(self._ab,
(callback,),
(self.__common_errback,))
dc.contact_guid = contact.id
dc()
def delete_contact(self, contact, done_cb=None, failed_cb=None):
def callback():
self.__remove_contact(contact, Membership.FORWARD, done_cb)
dc = scenario.ContactDeleteScenario(self._sharing,
self._ab,
(callback,),
(self.__common_errback, failed_cb))
dc.contact_guid = contact.id
dc.account = contact.account
dc.memberships = contact.memberships
dc.network = contact.network_id
dc()
def delete_contact(self, contact, done_cb=None, failed_cb=None):
def callback():
contact._remove_membership(Membership.FORWARD)
self.__common_callback('contact-deleted', done_cb, contact)
contact._reset()
if contact.memberships == Membership.NONE:
self.contacts.discard(contact)
dc = scenario.ContactDeleteScenario(self._ab,
(callback,),
(self.__common_errback, failed_cb))
dc.contact_guid = contact.id
dc()
def delete_contact(self, contact, done_cb=None, failed_cb=None):
def callback():
contact._remove_membership(Membership.FORWARD)
contact._reset()
self.__common_callback('contact-deleted', done_cb, contact)
if contact.memberships == Membership.NONE:
self.contacts.discard(contact)
dc = scenario.ContactDeleteScenario(self._ab,
(callback,),
(self.__common_errback, failed_cb))
dc.contact_guid = contact.id
dc()