Skip to content

Commit

Permalink
subscribe for deletion *before* sending to chat
Browse files Browse the repository at this point in the history
  • Loading branch information
quartata committed Mar 29, 2018
1 parent 2548465 commit eba1320
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions spamhandling.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ def handle_spam(post, reasons, why):

log('debug', GlobalVars.parser.unescape(s).encode('ascii', errors='replace'))
datahandling.append_to_latest_questions(post.post_site, post.post_id, post.title)
GlobalVars.deletion_watcher.subscribe(post_url)

for reason_count in range(5, 2, -1): # Try 5 reasons, then 4, then 3
reason = ", ".join(reasons[:reason_count])
Expand All @@ -148,8 +149,6 @@ def handle_spam(post, reasons, why):
else:
chatcommunicate.tell_rooms(message, ("all", "site-" + post.post_site),
without_roles, notify_site=post.post_site, report_data=(post_url, poster_url))

GlobalVars.deletion_watcher.subscribe(post_url)
except:
exc_type, exc_obj, exc_tb = sys.exc_info()
excepthook.uncaught_exception(exc_type, exc_obj, exc_tb)

0 comments on commit eba1320

Please sign in to comment.