Пример #1
0
def send_ban_message(subreddit, mod, user, note=None, days=None, new=True):
    sr_name = "/r/" + subreddit.name
    if days:
        subject = "you've been temporarily banned from %(subreddit)s"
        message = ("you have been temporarily banned from posting to "
            "%(subreddit)s. this ban will last for %(duration)s days.")
    else:
        subject = "you've been banned from %(subreddit)s"
        message = "you have been banned from posting to %(subreddit)s."

    if not new:
        subject = "Your ban from %(subreddit)s has changed"

    subject %= {"subreddit": sr_name}
    message %= {"subreddit": sr_name, "duration": days}

    if note:
        message += "\n\n" + 'note from the moderators:'
        message += "\n\n" + blockquote_text(note)

    message += "\n\n" + ("you can contact the moderators regarding your ban "
        "by replying to this message. **warning**: using other accounts to "
        "circumvent a subreddit ban is considered a violation of reddit's "
        "[site rules](/rules) and can result in being banned from reddit "
        "entirely.")

    item, inbox_rel = Message._new(
        mod, user, subject, message, request.ip, sr=subreddit, from_sr=True,
        can_send_email=False)
    queries.new_message(item, inbox_rel, update_modmail=False)
Пример #2
0
def send_ban_message(subreddit, mod, user, note=None, days=None, new=True):
    sr_name = "/r/" + subreddit.name
    if days:
        subject = "you've been temporarily banned from %(subreddit)s"
        message = ("you have been temporarily banned from posting to "
                   "%(subreddit)s. this ban will last for %(duration)s days.")
    else:
        subject = "you've been banned from %(subreddit)s"
        message = "you have been banned from posting to %(subreddit)s."

    if not new:
        subject = "Your ban from %(subreddit)s has changed"

    subject %= {"subreddit": sr_name}
    message %= {"subreddit": sr_name, "duration": days}

    if note:
        message += "\n\n" + 'note from the moderators:'
        message += "\n\n" + blockquote_text(note)

    message += "\n\n" + (
        "you can contact the moderators regarding your ban "
        "by replying to this message. **warning**: using other accounts to "
        "circumvent a subreddit ban is considered a violation of reddit's "
        "[site rules](/rules) and can result in being banned from reddit "
        "entirely.")

    item, inbox_rel = Message._new(mod,
                                   user,
                                   subject,
                                   message,
                                   request.ip,
                                   sr=subreddit,
                                   from_sr=True)
    queries.new_message(item, inbox_rel, update_modmail=False)
Пример #3
0
def send_ban_message(subreddit, mod, user, note=None, days=None, new=True):
    sr_name = "/r/" + subreddit.name
    if days:
        subject = "you've been temporarily banned from %(subreddit)s"
        message = ("you have been temporarily banned from posting to "
            "%(subreddit)s. this ban will last for %(duration)s days.")
    else:
        subject = "you've been banned from %(subreddit)s"
        message = "you have been banned from posting to %(subreddit)s."

    if not new:
        subject = "Your ban from %(subreddit)s has changed"

    subject %= {"subreddit": sr_name}
    message %= {"subreddit": sr_name, "duration": days}

    if note:
        message += "\n\n" + 'note from the moderators:'
        message += "\n\n" + blockquote_text(note)

    message += "\n\n" + ("you can contact the moderators regarding your ban "
        "by replying to this message. **warning**: using other accounts to "
        "circumvent a subreddit ban is considered a violation of reddit's "
        "[site rules](/help/contentpolicy#section_prohibited_behavior) "
        "and can result in the "
        "[suspension](https://reddit.zendesk.com/hc/articles/205687686) "
        "of your reddit account.")

    item, inbox_rel = Message._new(mod, user, subject, message, request.ip,
        sr=subreddit, from_sr=True)
    queries.new_message(item, inbox_rel, update_modmail=False)
Пример #4
0
def send_ban_message(subreddit, mod, user, note=None, days=None, new=True):
    sr_name = "/" + g.brander_community_abbr + "/" + subreddit.name
    if days:
        subject = "You've been temporarily banned from participating in %(subreddit)s"
        message = ("You have been temporarily banned from participating in "
                   "%(subreddit)s. This ban will last for %(duration)s days. ")
    else:
        subject = "You've been banned from participating in %(subreddit)s"
        message = "You have been banned from participating in %(subreddit)s. "

    message += ("You can still view and subscribe to %(subreddit)s, but you "
                "won't be able to post or comment.")

    if not new:
        subject = "Your ban from %(subreddit)s has changed"

    subject %= {"subreddit": sr_name}
    message %= {"subreddit": sr_name, "duration": days}

    if note:
        message += "\n\n" + 'Note from the moderators:'
        message += "\n\n" + blockquote_text(note)

    message += "\n\n" + (
        "If you have a question regarding your ban, you can "
        "contact the moderator team for %(subreddit)s by replying to this "
        "message.") % {
            "subreddit": sr_name
        }

    message += "\n\n" + (
        "**Reminder from the %(site_name)s staff**: If you use "
        "another account to circumvent this sub ban, that will be "
        "considered a violation of [the Content Policy](/s/SaidIt/comments/j1/the_saiditnet_terms_and_content_policy/) "
        "and can result in your account being suspended"
        "from the site as a whole.") % {
            "site_name": g.brander_site
        }

    item, inbox_rel = Message._new(mod,
                                   user,
                                   subject,
                                   message,
                                   request.ip,
                                   sr=subreddit,
                                   from_sr=True,
                                   can_send_email=False)
    queries.new_message(item, inbox_rel, update_modmail=False)
Пример #5
0
def send_ban_message(subreddit, mod, user, note=None, days=None, new=True):
    sr_name = "/r/" + subreddit.name
    if days:
        subject = "You've been temporarily banned from participating in %(subreddit)s"
        message = ("You have been temporarily banned from participating in "
                   "%(subreddit)s. This ban will last for %(duration)s days. ")
    else:
        subject = "You've been banned from participating in %(subreddit)s"
        message = "You have been banned from participating in %(subreddit)s. "

    message += ("You can still view and subscribe to %(subreddit)s, but you "
                "won't be able to post or comment.")

    if not new:
        subject = "Your ban from %(subreddit)s has changed"

    subject %= {"subreddit": sr_name}
    message %= {"subreddit": sr_name, "duration": days}

    if note:
        message += "\n\n" + 'Note from the moderators:'
        message += "\n\n" + blockquote_text(note)

    message += "\n\n" + (
        "If you have a question regarding your ban, you can "
        "contact the moderator team for %(subreddit)s by replying to this "
        "message.") % {
            "subreddit": sr_name
        }

    message += "\n\n" + (
        "**Reminder from the Reddit staff**: If you use "
        "another account to circumvent this subreddit ban, that will be "
        "considered a violation of [the Content Policy](/help/contentpolicy#section_prohibited_behavior) "
        "and can result in your account being [suspended](https://reddit.zendesk.com/hc/en-us/articles/205687686) "
        "from the site as a whole.")

    item, inbox_rel = Message._new(mod,
                                   user,
                                   subject,
                                   message,
                                   request.ip,
                                   sr=subreddit,
                                   from_sr=True,
                                   can_send_email=False,
                                   is_auto_modmail=True)
    queries.new_message(item, inbox_rel, update_modmail=False)
Пример #6
0
def send_ban_message(subreddit, mod, user, note=None, days=None, new=True):
    sr_name = "/r/" + subreddit.name
    if days:
        subject = "You've been temporarily banned from participating in %(subreddit)s"
        message = ("You have been temporarily banned from participating in "
            "%(subreddit)s. This ban will last for %(duration)s days. ")
    else:
        subject = "You've been banned from participating in %(subreddit)s"
        message = "You have been banned from participating in %(subreddit)s. "

    message += ("You can still view and subscribe to %(subreddit)s, but you "
                "won't be able to post or comment.")

    if not new:
        subject = "Your ban from %(subreddit)s has changed"

    subject %= {"subreddit": sr_name}
    message %= {"subreddit": sr_name, "duration": days}

    if note:
        message += "\n\n" + 'Note from the moderators:'
        message += "\n\n" + blockquote_text(note)

    message += "\n\n" + ("If you have a question regarding your ban, you can "
        "contact the moderator team for %(subreddit)s by replying to this "
        "message.") % {"subreddit": sr_name}

    message += "\n\n" + ("**Reminder from the Reddit staff**: If you use "
        "another account to circumvent this subreddit ban, that will be "
        "considered a violation of [the Content Policy](/help/contentpolicy#section_prohibited_behavior) "
        "and can result in your account being [suspended](https://reddit.zendesk.com/hc/en-us/articles/205687686) "
        "from the site as a whole.")

    item, inbox_rel = Message._new(
        mod, user, subject, message, request.ip, sr=subreddit, from_sr=True,
        can_send_email=False, is_auto_modmail=True)
    queries.new_message(item, inbox_rel, update_modmail=False)