From 0dc3bbb26b8b9224b6612ac2fc2d5d42d50a92f7 Mon Sep 17 00:00:00 2001 From: Keith Mitchell Date: Tue, 14 Feb 2012 16:14:32 -0800 Subject: [PATCH] Don't clutter modmail with ban messages --- r2/r2/lib/comment_tree.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/r2/r2/lib/comment_tree.py b/r2/r2/lib/comment_tree.py index b248539ff..54cafe32f 100644 --- a/r2/r2/lib/comment_tree.py +++ b/r2/r2/lib/comment_tree.py @@ -364,7 +364,9 @@ def add_message(message): if message.to_id: with g.make_lock(messages_lock_key(message.to_id)): add_message_nolock(message.to_id, message) - if message.sr_id: + # Messages to a subreddit should end in its inbox. Messages + # FROM a subreddit (currently, just ban messages) should NOT + if message.sr_id and not message.from_sr: with g.make_lock(sr_messages_lock_key(message.sr_id)): add_sr_message_nolock(message.sr_id, message)