fix anti-spam

This commit is contained in:
Yax 2018-01-28 18:20:42 +01:00
parent 03ee9a1e0b
commit 5d6574fb37
2 changed files with 5 additions and 6 deletions

View file

@ -42,7 +42,7 @@ class Processor(Thread):
try:
msg = queue.get()
if msg['request'] == 'new_comment':
new_comment(msg['data'])
new_comment(msg['data'], msg.get('clientip', ''))
elif msg['request'] == 'new_mail':
reply_comment_email(msg['data'])
elif msg['request'] == 'unsubscribe':
@ -59,7 +59,7 @@ class Processor(Thread):
logger.exception("processing failure")
def new_comment(data):
def new_comment(data, clientip):
logger.info('new comment received: %s' % data)
@ -70,7 +70,6 @@ def new_comment(data):
author_site = data.get('site', '').strip()
message = data.get('message', '')
subscribe = data.get('subscribe', '')
clientip = data.get('clientip', '')
# private mode: email contains gravar md5 hash
if config.security['private']: