Ejemplo n.º 1
0
        def connect_success(transp):
            self._sso = SSO.SingleSignOn(self.profile.account,
                                         self.profile.password,
                                         self._proxies)
            self._address_book = AB.AddressBook(self._sso, self, self._proxies)
            self.__connect_addressbook_signals()
            self._oim_box = OIM.OfflineMessagesBox(self._sso, self, self._proxies)
            self.__connect_oim_box_signals()
            self._spaces = Spaces.Spaces(self._sso, self._proxies)

            self._state = ClientState.CONNECTED
Ejemplo n.º 2
0
        def connect_success(transp):
            self._sso = SSO.SingleSignOn(self.profile.account,
                                         self.profile.password,
                                         self._proxies)
            self._address_book = AB.AddressBook(self._sso, self, self._proxies)
            self._mailbox = msnp.Mailbox(self._protocol)
            self._oim_box = OIM.OfflineMessagesBox(self._sso, self, self._proxies)
            self._spaces = Spaces.Spaces(self._sso, self._proxies)
            self._roaming = CR.ContentRoaming(self._sso, self._address_book, self._proxies)
            self._turn_client = TURNClient(self._sso, self.profile.account)

            self.__connect_addressbook_signals()
            self.__connect_mailbox_signals()
            self.__connect_oim_box_signals()
            self.__connect_roaming_signals()

            self._state = ClientState.CONNECTED
Ejemplo n.º 3
0
        account = raw_input('Account: ')
    else:
        account = sys.argv[1]

    if len(sys.argv) < 3:
        password = getpass.getpass('Password: ')
    else:
        password = sys.argv[2]

    mainloop = gobject.MainLoop(is_running=True)

    signal.signal(signal.SIGTERM,
                  lambda *args: gobject.idle_add(mainloop.quit()))

    def sso_callback(arg):
        print arg

    def sso_errback():
        pass

    sso = SingleSignOn(account, password)

    box = OfflineMessagesBox(sso)
    box.sync()

    while mainloop.is_running():
        try:
            mainloop.run()
        except KeyboardInterrupt:
            mainloop.quit()
Ejemplo n.º 4
0
            #address_book.block_contact(address_book.contacts.search_by_account('*****@*****.**')[0])
            #address_book.unblock_contact(address_book.contacts[0])
            #address_book.block_contact(address_book.contacts[0])
            #contact = address_book.contacts[2]
            #address_book.delete_contact(contact)
            #address_book.delete_contact(contact)
            #g=list(address_book.groups)
            #address_book.add_messenger_contact("*****@*****.**",groups=g)

            #for i in range(5):
            #    address_book.delete_contact(address_book.contacts[i])
            #address_book.add_messenger_contact("*****@*****.**")

    def messenger_contact_added(address_book, contact):
        print "Added contact : %s (%s) %s %s" % (contact.account,
                                                 contact.display_name,
                                                 contact.network_id,
                                                 contact.memberships)

    sso = SingleSignOn(account, password, proxies=get_proxies())
    address_book = AddressBook(sso, proxies=get_proxies())
    address_book.connect("notify::state", address_book_state_changed)
    address_book.connect("messenger-contact-added", messenger_contact_added)
    address_book.sync()

    while mainloop.is_running():
        try:
            mainloop.run()
        except KeyboardInterrupt:
            mainloop.quit()