Exemplo n.º 1
0
def handle_user_with_all_spam(user, why):
    user_id = user[0]
    site = user[1]
    tab = "activity" if site == "stackexchange.com" else "topactivity"
    s = "[ [SmokeDetector](//git.io/vgx7b) ] All of this user's posts are spam: [user {} on {}](//{}/users/{}?tab={})" \
        .format(user_id, site, site, user_id, tab)
    print GlobalVars.parser.unescape(s).encode('ascii', errors='replace')
    datahandling.add_why_allspam(user, why)
    if time.time() >= GlobalVars.blockedTime[GlobalVars.charcoal_room_id]:
        GlobalVars.charcoal_hq.send_message(s)
    for specialroom in GlobalVars.specialrooms:
        room = specialroom["room"]
        if site in specialroom["sites"] and (room.id not in GlobalVars.blockedTime or time.time() >= GlobalVars.blockedTime[room.id]):
            room.send_message(s)
Exemplo n.º 2
0
def handle_user_with_all_spam(user, why):
    user_id = user[0]
    site = user[1]
    tab = "activity" if site == "stackexchange.com" else "topactivity"
    s = "[ [SmokeDetector](//git.io/vgx7b) ] All of this user's posts are spam: [user {} on {}](//{}/users/{}?tab={})" \
        .format(user_id, site, site, user_id, tab)
    log('debug', GlobalVars.parser.unescape(s).encode('ascii', errors='replace'))
    datahandling.add_why_allspam(user, why)
    if time.time() >= GlobalVars.blockedTime[GlobalVars.charcoal_room_id]:
        GlobalVars.charcoal_hq.send_message(s)
    for specialroom in GlobalVars.specialrooms:
        room = specialroom["room"]
        if site in specialroom["sites"] and (room.id not in GlobalVars.blockedTime or
                                             time.time() >= GlobalVars.blockedTime[room.id]):
            room.send_message(s)