fix loop bug on multiple URL given

This commit is contained in:
urlbot
2014-12-14 16:01:09 +01:00
parent e2e16896b5
commit 54c590051c

View File

@@ -148,6 +148,7 @@ def extract_url(data, msg_obj):
return
ret = None
out = []
for url in result:
ratelimit_touch()
if ratelimit_exceeded(msg_obj):
@@ -158,6 +159,7 @@ def extract_url(data, msg_obj):
if not None is re.match(b, url):
flag = True
logger('info', 'url blacklist match for ' + url)
break
if flag:
# an URL has matched the blacklist, continue to the next URL
@@ -204,10 +206,13 @@ def extract_url(data, msg_obj):
message = message.replace('\n', '\\n')
logger('info', 'printing ' + message)
send_reply(message, msg_obj)
logger('info', 'adding to out buf: ' + message)
out.append(message)
ret = True
if True == ret:
send_reply(out, msg_obj)
return ret
def handle_msg(msg_obj):