Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove feature flag for modmail muting
  • Loading branch information
MelissaCole committed Oct 8, 2015
1 parent 63a7d8b commit 3ca7e7c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 27 deletions.
1 change: 0 additions & 1 deletion r2/example.ini
Expand Up @@ -873,4 +873,3 @@ feature_upgrade_cookies = off
feature_multireddit_customizations = off
# Test if `https_testing_img_test` is loaded with an acceptable HTTPS cert according to users' browsers
feature_test_https_certs = off
feature_modmail_muting = off
12 changes: 0 additions & 12 deletions r2/r2/controllers/api.py
Expand Up @@ -829,9 +829,6 @@ def POST_unfriend(self, nuser, iuser, container, type):
Complement to [POST_friend](#POST_api_friend)
"""
if type == 'muted' and not feature.is_enabled('modmail_muting'):
return abort(403, "This feature is not yet enabled")

self.check_api_friend_oauth_scope(type)

victim = iuser or nuser
Expand Down Expand Up @@ -974,9 +971,6 @@ def POST_friend(self, form, jquery, friend,
Complement to [POST_unfriend](#POST_api_unfriend)
"""
if type == 'muted' and not feature.is_enabled('modmail_muting'):
return abort(403, "This feature is not yet enabled")

self.check_api_friend_oauth_scope(type)

if type in self._sr_friend_types:
Expand Down Expand Up @@ -1767,9 +1761,6 @@ def POST_mute_message_author(self, message):
if not subreddit:
abort(403, 'Not modmail')

if not feature.is_enabled('modmail_muting', subreddit=subreddit.name):
return abort(403, "This feature is not yet enabled")

user = message.author_slow
if not c.user_is_admin:
if not subreddit.is_moderator_with_perms(c.user, 'access', 'mail'):
Expand Down Expand Up @@ -1807,9 +1798,6 @@ def POST_unmute_message_author(self, message):
if not subreddit:
abort(403, 'Not modmail')

if not feature.is_enabled('modmail_muting', subreddit=subreddit.name):
return abort(403, "This feature is not yet enabled")

user = message.author_slow
if not c.user_is_admin:
if not subreddit.is_moderator_with_perms(c.user, 'access', 'mail'):
Expand Down
2 changes: 0 additions & 2 deletions r2/r2/controllers/listingcontroller.py
Expand Up @@ -1743,8 +1743,6 @@ def GET_listing(self, where, user=None, **kw):
elif where == 'muted':
if not has_mod_access:
abort(403)
if not feature.is_enabled('modmail_muting'):
abort(403)
self.listing_cls = MutedListing

elif where == 'wikibanned':
Expand Down
4 changes: 1 addition & 3 deletions r2/r2/lib/pages/pages.py
Expand Up @@ -506,9 +506,7 @@ def sr_admin_menu(self):
if is_single_subreddit:
if is_moderator_with_perms('access'):
buttons.append(NamedButton("banned", css_class="reddit-ban"))

if (is_moderator_with_perms('access', 'mail') and
feature.is_enabled("modmail_muting")):
if is_moderator_with_perms('access', 'mail'):
buttons.append(NamedButton("muted", css_class="reddit-mute"))
if is_moderator_with_perms('flair'):
buttons.append(NamedButton("flair", css_class="reddit-flair"))
Expand Down
17 changes: 8 additions & 9 deletions r2/r2/lib/pages/things.py
Expand Up @@ -269,15 +269,14 @@ def __init__(self, thing, delete = False, report = True):

if thing.sr_id:
sr = thing.subreddit_slow
if feature.is_enabled('modmail_muting', subreddit=sr.name):
if (sr.is_muted(first_message.author_slow) or
(first_message.to_id and
sr.is_muted(first_message.recipient_slow))):
can_reply = False

if (not sr.is_moderator(thing.author_slow) and
sr.is_moderator_with_perms(c.user, 'access', 'mail')):
can_mute = True
if (sr.is_muted(first_message.author_slow) or
(first_message.to_id and
sr.is_muted(first_message.recipient_slow))):
can_reply = False

if (not sr.is_moderator(thing.author_slow) and
sr.is_moderator_with_perms(c.user, 'access', 'mail')):
can_mute = True

if not was_comment and thing.display_author:
can_block = False
Expand Down

0 comments on commit 3ca7e7c

Please sign in to comment.