Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def accept_contact_invitation(self, pending_contact, add_to_contact_list=True):
def callback(contact_infos, memberships):
pending_contact.freeze_notify()
pending_contact._id = contact_infos.Id
pending_contact._cid = contact_infos.CID
pending_contact._set_memberships(memberships)
pending_contact.thaw_notify()
self.emit('contact-accepted', pending_contact)
ai = scenario.AcceptInviteScenario(self._ab, self._sharing,
(callback,),
(self.__common_errback,))
ai.account = pending_contact.account
ai.network = pending_contact.network_id
ai.memberships = pending_contact.memberships
ai.add_to_contact_list = add_to_contact_list
ai()
def contact_added(pending_contact):
ai = scenario.AcceptInviteScenario(self._sharing,
(callback, pending_contact),
(self.__common_errback, failed_cb),
pending_contact.account,
pending_contact.memberships,
pending_contact.network_id)
ai()
def accept_contact_invitation(self, pending_contact, add_to_contact_list=True,
done_cb=None, failed_cb=None):
def callback(contact_infos, memberships):
self.__update_contact(pending_contact, memberships, contact_infos)
self.__common_callback('contact-accepted', done_cb, pending_contact)
ai = scenario.AcceptInviteScenario(self._ab, self._sharing,
(callback,),
(self.__common_errback, failed_cb))
ai.account = pending_contact.account
ai.network = pending_contact.network_id
ai.memberships = pending_contact.memberships
ai.add_to_contact_list = add_to_contact_list
ai()
def accept_contact_invitation(self, pending_contact, add_to_contact_list=True,
done_cb=None, failed_cb=None):
def callback(contact_infos, memberships):
self.__update_contact(pending_contact, memberships, contact_infos)
self.__common_callback('contact-accepted', done_cb, pending_contact)
ai = scenario.AcceptInviteScenario(self._ab, self._sharing,
(callback,),
(self.__common_errback, failed_cb))
ai.account = pending_contact.account
ai.network = pending_contact.network_id
ai.memberships = pending_contact.memberships
ai.add_to_contact_list = add_to_contact_list
ai()