diff --git a/r2/r2/lib/automoderator.py b/r2/r2/lib/automoderator.py index 42d2f3c1f..a7e6513ef 100644 --- a/r2/r2/lib/automoderator.py +++ b/r2/r2/lib/automoderator.py @@ -66,6 +66,7 @@ from r2.models import ( Comment, DeletedUser, Frontpage, + Inbox, LastModified, Link, Message, @@ -1432,6 +1433,14 @@ class Rule(object): new_comment.distinguished = "yes" new_comment.sendreplies = False new_comment._commit() + + # If the comment isn't going to be put into the user's inbox + # due to them having sendreplies disabled, force it. For a normal + # mod, distinguishing the comment would do this, but it doesn't + # happen here since we're setting .distinguished directly. + if isinstance(item, Link) and not inbox_rel: + inbox_rel = Inbox._add(data["author"], new_comment, "selfreply") + queries.new_comment(new_comment, inbox_rel) if self.comment_stickied: