From 06536674d13d696db629b0cafdef5a6df16dd3f5 Mon Sep 17 00:00:00 2001 From: Chad Birch Date: Thu, 14 Mar 2013 13:24:53 -0600 Subject: [PATCH] Don't show removed comments in /comments listing --- r2/r2/controllers/listingcontroller.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/r2/r2/controllers/listingcontroller.py b/r2/r2/controllers/listingcontroller.py index f48effaaa..f2761a877 100755 --- a/r2/r2/controllers/listingcontroller.py +++ b/r2/r2/controllers/listingcontroller.py @@ -1039,6 +1039,15 @@ class MyredditsController(ListingController, OAuth2ResourceController): 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()