Exemple #1
0
    def handle_response(self, request, response):
        '''handle the response'''
        if response.status == 200:
            #self.msg_queue.add_event(e3.Event.EVENT_OIM_SEND_SUCCEED, self.oid)
            log.debug('OIM sent ' + self.contact)
        else:
            start = '<LockKeyChallenge xmlns="http://messenger.msn.com/'\
                    'ws/2004/09/oim/">'
            end = '</LockKeyChallenge>'
            lockkey_hash = common.get_value_between(response.body, start, end)

            if lockkey_hash:
                lockkey = challenge.do_challenge(str(lockkey_hash))
                SendOIM(self.session, self.msg_queue, self.contact,
                        self.message, lockkey, self.seq+1, False).start()
            else:
                log.debug('Can\'t send OIM, fail')
                log.debug(response.body)
                self.session.add_event(e3.Event.EVENT_ERROR,
                             'to many retries sending oims')
                log.debug('to many retries sending oim')
Exemple #2
0
    def handle_response(self, request, response):
        '''handle the response'''
        if response.status == 200:
            #self.msg_queue.add_event(e3.Event.EVENT_OIM_SEND_SUCCEED, self.oid)
            log.debug('OIM sent ' + self.contact)
        else:
            start = '<LockKeyChallenge xmlns="http://messenger.msn.com/'\
                    'ws/2004/09/oim/">'
            end = '</LockKeyChallenge>'
            lockkey_hash = common.get_value_between(response.body, start, end)

            if lockkey_hash:
                lockkey = challenge.do_challenge(str(lockkey_hash))
                SendOIM(self.session, self.msg_queue, self.contact,
                        self.message, lockkey, self.seq+1, False).start()
            else:
                log.debug('Can\'t send OIM, fail')
                log.debug(response.body)
                self.session.add_event(e3.Event.EVENT_ERROR,
                             'to many retries sending oims')
                log.debug('to many retries sending oim')
Exemple #3
0
 def _on_challenge(self, message):
     '''handle the challenge sent by the server'''
     out = challenge.do_challenge(message.params[0][:-2])
     self.socket.send_command('QRY', (challenge._PRODUCT_ID,) , out)
Exemple #4
0
 def _on_challenge(self, message):
     '''handle the challenge sent by the server'''
     out = challenge.do_challenge(message.params[0][:-2])
     self.socket.send_command('QRY', (challenge._PRODUCT_ID, ), out)