mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
Feature flag modmail muting
This commit is contained in:
@@ -339,6 +339,7 @@ newsletter_list_id =
|
||||
############################################ QUOTAS
|
||||
# quota for various types of relations creatable in subreddits
|
||||
sr_banned_quota = 10000
|
||||
sr_muted_quota = 10000
|
||||
sr_moderator_invite_quota = 10000
|
||||
sr_contributor_quota = 10000
|
||||
sr_wikibanned_quota = 10000
|
||||
@@ -874,3 +875,4 @@ feature_give_hsts_grants = 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
|
||||
|
||||
@@ -855,6 +855,9 @@ class ApiController(RedditController):
|
||||
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
|
||||
@@ -997,6 +1000,9 @@ class ApiController(RedditController):
|
||||
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:
|
||||
@@ -1766,6 +1772,9 @@ class ApiController(RedditController):
|
||||
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'):
|
||||
@@ -1800,6 +1809,9 @@ class ApiController(RedditController):
|
||||
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'):
|
||||
|
||||
@@ -1750,6 +1750,8 @@ class UserListListingController(ListingController):
|
||||
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':
|
||||
|
||||
@@ -494,6 +494,9 @@ class Reddit(Templated):
|
||||
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")):
|
||||
buttons.append(NamedButton("muted", css_class="reddit-mute"))
|
||||
if is_moderator_with_perms('flair'):
|
||||
buttons.append(NamedButton("flair", css_class="reddit-flair"))
|
||||
|
||||
@@ -241,14 +241,15 @@ class MessageButtons(PrintableButtons):
|
||||
|
||||
if thing.sr_id:
|
||||
sr = thing.subreddit_slow
|
||||
if (sr.is_muted(first_message.author_slow) or
|
||||
(first_message.to_id and
|
||||
sr.is_muted(first_message.recipient_slow))):
|
||||
is_muted = True
|
||||
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))):
|
||||
is_muted = True
|
||||
|
||||
if (not sr.is_moderator(thing.author_slow) and
|
||||
sr.is_moderator_with_perms(c.user, 'access', 'mail')):
|
||||
can_mute = True
|
||||
if (not sr.is_moderator(thing.author_slow) and
|
||||
sr.is_moderator_with_perms(c.user, 'access', 'mail')):
|
||||
can_mute = True
|
||||
|
||||
can_reply = (c.user_is_loggedin and
|
||||
getattr(thing, "repliable", True) and
|
||||
|
||||
Reference in New Issue
Block a user