From 4e74f1c28adb99338bc8d4267d55ff7ed2327407 Mon Sep 17 00:00:00 2001 From: Chad Birch Date: Fri, 1 Mar 2013 11:22:14 -0700 Subject: [PATCH] Fix top-level distinguished comment messages The new "sendreplies" feature introduced a conflict since this feature was assuming that self-posts would always send messages for replies and that links never would. That's no longer true. --- r2/r2/controllers/api.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/r2/r2/controllers/api.py b/r2/r2/controllers/api.py index db245c888..747dfebcf 100755 --- a/r2/r2/controllers/api.py +++ b/r2/r2/controllers/api.py @@ -1997,15 +1997,15 @@ class ApiController(RedditController, OAuth2ResourceController): else: # From no to yes send_message = True - # Send a message if this is a top-level comment on a link, - # if it's the first distinguish for this comment, - # and if the user isn't banned or blocked by the link author + # Send a message if this is a top-level comment on a submission that + # does not have sendreplies set, if it's the first distinguish for this + # comment, and if the user isn't banned or blocked by the author if isinstance(thing, Comment): link = Link._byID(thing.link_id, data=True) to = Account._byID(link.author_id, data=True) if (send_message and thing.parent_id is None and - not link.is_self and + not link.sendreplies and not hasattr(thing, 'distinguished') and not c.user._spam and c.user._id not in to.enemies and