How to use the scenario.AcceptInviteScenario function in scenario

To help you get started, we’ve selected a few scenario examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github drf / amsn2 / pymsn / pymsn / service / AddressBook / address_book.py View on Github external
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()
github emesene / emesene / emesene / e3 / papylib / papyon / papyon / service / AddressBook / address_book.py View on Github external
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()
github Kjir / papyon / papyon / service / AddressBook / address_book.py View on Github external
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()
github emesene / emesene / mesinyer / papyon / service / AddressBook / address_book.py View on Github external
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()