Skip to content

Commit

Permalink
Add comment explaining use of orangered keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
kemitche committed Jul 7, 2011
1 parent 4d7a2fa commit b2c0a12
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions r2/r2/models/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,8 @@ def _new(cls, author, link, parent, body, ip):
# the author
if to and ((not c._spam and author._id not in to.enemies)
or to.name in g.admins):
# When replying to your own comment, record the inbox
# relation, but don't give yourself an orangered
orangered = (to.name != author.name)
inbox_rel = Inbox._add(to, c, name, orangered=orangered)

Expand Down Expand Up @@ -968,6 +970,8 @@ def _new(cls, author, to, subject, body, ip, parent = None, sr = None):
# if the current "to" is not a sr moderator,
# they need to be notified
if not sr_id or not sr.is_moderator(to):
# Record the inbox relation, but don't give the user
# an orangered, if they PM themselves.
# Don't notify on PMs from blocked users, either
orangered = (to.name != author.name and
author._id not in to.enemies)
Expand Down

0 comments on commit b2c0a12

Please sign in to comment.