Permalink
Browse files

Don't show removed comments in /comments listing

  • Loading branch information...
1 parent e61de2b commit 06536674d13d696db629b0cafdef5a6df16dd3f5 @Deimos Deimos committed Mar 14, 2013
Showing with 9 additions and 0 deletions.
  1. +9 −0 r2/r2/controllers/listingcontroller.py
@@ -1039,6 +1039,15 @@ def GET_listing(self, where='subscriber', **env):
class CommentsController(ListingController):
title_text = _('comments')
+ def keep_fn(self):
+ def keep(item):
+ return (not item._spam or
+ (c.user_is_loggedin and
+ (item.author_id == c.user._id or
+ c.user_is_admin or
+ item.subreddit.is_moderator(c.user))))
+ return keep
+
def query(self):
return c.site.get_all_comments()

0 comments on commit 0653667

Please sign in to comment.