예제 #1
0
    def handle_message(self, stanza):
        if stanza.stanza_type == 'chat' and not hasattr(stanza, 'processed'):
            #print stanza
            stanza.processed = True

            to_jid = stanza.to_jid.as_unicode()
            from_jid = stanza.from_jid.as_unicode()
            
            im_tcp_tunneler.handle_message(from_jid, to_jid, stanza.body)
            
        return True
예제 #2
0
    def handle_message(self, stanza):
        if stanza.stanza_type == 'chat' and not hasattr(stanza, 'processed'):
            #print stanza
            stanza.processed = True

            to_jid = stanza.to_jid.as_unicode()
            from_jid = stanza.from_jid.as_unicode()

            im_tcp_tunneler.handle_message(from_jid, to_jid, stanza.body)

        return True
예제 #3
0
def onApplicationReceiving(app_, streams):
    if app_.Name != app.Name: return False
    while 1:
        ret = False
        for strm in list(streams):
            ret = True
            try:
                data = strm.read()
                if DBG1: print 'received: %s: len(data)=%d' % (strm, len(data))
                if DBG2: print 'received: %s: %r' % (strm, data)
                im_tcp_tunneler.handle_message(strm.PartnerHandle, skype.CurrentUser.Handle, data)
            except:
                traceback.print_exc()
        if 1: break
        if not ret: break
    return ret
예제 #4
0
def onApplicationReceiving(app_, streams):
    if app_.Name != app.Name: return False
    while 1:
        ret = False
        for strm in list(streams):
            ret = True
            try:
                try:
                    data = strm.read()
                except Skype4Py.errors.SkypeError, e:
                    traceback.print_exc()
                    if config_ns.get('skype_strict_errors', False) and 'APPLICATION: operation failed' in str(e):
                        global keep_running; keep_running = False
                    continue
                if DBG1: print 'received: %s: len(data)=%d' % (strm, len(data))
                if DBG2: print 'received: %s: %r' % (strm, data)
                im_tcp_tunneler.handle_message(strm.PartnerHandle, skype.CurrentUser.Handle, data)
            except:
예제 #5
0
def onApplicationReceiving(app_, streams):
    if app_.Name != app.Name: return False
    while 1:
        ret = False
        for strm in list(streams):
            ret = True
            try:
                try:
                    data = strm.read()
                except Skype4Py.errors.SkypeError, e:
                    traceback.print_exc()
                    if config_ns.get(
                            'skype_strict_errors', False
                    ) and 'APPLICATION: operation failed' in str(e):
                        global keep_running
                        keep_running = False
                    continue
                if DBG1: print 'received: %s: len(data)=%d' % (strm, len(data))
                if DBG2: print 'received: %s: %r' % (strm, data)
                im_tcp_tunneler.handle_message(strm.PartnerHandle,
                                               skype.CurrentUser.Handle, data)
            except: