mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
Add stats events for spam-related stuff.
This commit is contained in:
@@ -253,9 +253,10 @@ class ApiController(RedditController):
|
||||
check_domain = True
|
||||
|
||||
# check for no url, or clear that error field on return
|
||||
if form.has_errors("url", errors.NO_URL, errors.BAD_URL,
|
||||
errors.DOMAIN_BANNED):
|
||||
if form.has_errors("url", errors.NO_URL, errors.BAD_URL):
|
||||
pass
|
||||
elif form.has_errors("url", errors.DOMAIN_BANNED):
|
||||
g.stats.simple_event('spam.shame.link')
|
||||
elif form.has_errors("url", errors.ALREADY_SUB):
|
||||
check_domain = False
|
||||
u = url[0].already_submitted_link
|
||||
@@ -316,6 +317,7 @@ class ApiController(RedditController):
|
||||
c.user, sr, ip, spam=c.user._spam)
|
||||
|
||||
if banmsg:
|
||||
g.stats.simple_event('spam.domainban.link_url')
|
||||
admintools.spam(l, banner = "domain (%s)" % banmsg)
|
||||
|
||||
if kind == 'self':
|
||||
|
||||
@@ -132,6 +132,7 @@ class Link(Thing, Printable):
|
||||
l._commit()
|
||||
l.set_url_cache()
|
||||
if author._spam:
|
||||
g.stats.simple_event('spam.autoremove.link')
|
||||
admintools.spam(l, banner='banned user')
|
||||
return l
|
||||
|
||||
@@ -645,6 +646,9 @@ class Comment(Thing, Printable):
|
||||
|
||||
c._spam = author._spam
|
||||
|
||||
if author._spam:
|
||||
g.stats.simple_event('spam.autoremove.comment')
|
||||
|
||||
#these props aren't relations
|
||||
if parent:
|
||||
c.parent_id = parent._id
|
||||
@@ -992,6 +996,10 @@ class Message(Thing, Printable):
|
||||
m = Message(subject=subject, body=body, author_id=author._id, new=True,
|
||||
ip=ip, from_sr=from_sr)
|
||||
m._spam = author._spam
|
||||
|
||||
if author._spam:
|
||||
g.stats.simple_event('spam.autoremove.message')
|
||||
|
||||
sr_id = None
|
||||
# check to see if the recipient is a subreddit and swap args accordingly
|
||||
if to and isinstance(to, Subreddit):
|
||||
|
||||
Reference in New Issue
Block a user