Beispiel #1
0
def contact_acked(sessionkey, target_username, ackpacket, info):
    lg.out(6, 'django.contact_acked: %s' % str((sessionkey, target_username, ackpacket, info)))
    global _SearchLookups
    try:
        results = _SearchLookups[sessionkey][target_username]
        for i in xrange(len(results)):
            result = results[i]
            if result['idurl'] == ackpacket.OwnerID:
                if ackpacket.Command == commands.Ack():
                    new_status = contact_status.getStatusLabel(ackpacket.OwnerID)
                    _SearchLookups[sessionkey][target_username][i]['status'] = new_status
                    break
    except:
        lg.exc()
Beispiel #2
0
def contact_acked(sessionkey, target_username, ackpacket, info):
    lg.out(6, 'django.contact_acked: %s' % str((sessionkey, target_username, ackpacket, info)))
    global _SearchLookups
    try:
        results = _SearchLookups[sessionkey][target_username]
        for i in xrange(len(results)):
            result = results[i]
            if result['idurl'] == ackpacket.OwnerID:
                if ackpacket.Command == commands.Ack():
                    new_status = contact_status.getStatusLabel(ackpacket.OwnerID)
                    _SearchLookups[sessionkey][target_username][i]['status'] = new_status
                    break
    except:
        lg.exc()
Beispiel #3
0
def nickname_observer_result(sessionkey, target_username, result, nik, pos, idurl):
    lg.out(6, 'django.nickname_observer_result: %s' % str((sessionkey, target_username, result, nik, idurl)))
    global _SearchLookups
    try:
        status = ''
        if result == 'exist':
            if contact_status.isKnown(idurl):
                status = contact_status.getStatusLabel(idurl)
            else:
                propagate.single(idurl,
                                 ack_handler=lambda ackpacket, info:
                                 contact_acked(sessionkey, target_username, ackpacket, info),
                                 fail_handler=lambda failpacket, info:
                                 contact_failed(sessionkey, target_username, failpacket, info),
                                 wide=True)
                status = 'checking'
            _SearchLookups[sessionkey][target_username].append({
                'nickname': nik,
                'position': pos,
                'idurl': idurl,
                'status': status, })
    except:
        lg.exc()
        return
Beispiel #4
0
def nickname_observer_result(sessionkey, target_username, result, nik, pos, idurl):
    lg.out(6, 'django.nickname_observer_result: %s' % str((sessionkey, target_username, result, nik, idurl)))
    global _SearchLookups
    try:
        status = ''
        if result == 'exist':
            if contact_status.isKnown(idurl):
                status = contact_status.getStatusLabel(idurl)
            else:
                propagate.single(idurl,
                                 ack_handler=lambda ackpacket, info:
                                     contact_acked(sessionkey, target_username, ackpacket, info),
                                 fail_handler=lambda failpacket, info:
                                     contact_failed(sessionkey, target_username, failpacket, info),
                                 wide=True)
                status = 'checking'
            _SearchLookups[sessionkey][target_username].append({
                'nickname': nik,
                'position': pos,
                'idurl': idurl,
                'status': status, })
    except:
        lg.exc()
        return