admin pings: truescore requirement and exclude shadowban and make a permission

remotes/1693176582716663532/tmp_refs/heads/watchparty
justcool393 2022-10-22 19:45:15 -05:00
parent cc3fb59ccd
commit a2c16534a4
2 changed files with 4 additions and 2 deletions

View File

@ -91,8 +91,8 @@ def NOTIFY_USERS(text, v):
names = set(m.group(2) for m in mention_regex.finditer(text))
for user in get_users(names, graceful=True):
if user.username == 'jannies':
admins = [x[0] for x in g.db.query(User.id).filter(User.admin_level > 1).all()]
if user.username == 'jannies' and v.truecoins >= ADMIN_PING_TRUESCORE_MINIMUM and not v.shadowbanned:
admins = [x[0] for x in g.db.query(User.id).filter(User.admin_level >= PERMS['NOTIFICATIONS_ADMIN_PING']).all()]
notify_users.update(admins)
elif v.id != user.id and not v.any_block_exists(user):
notify_users.add(user.id)

View File

@ -221,6 +221,7 @@ PERMS = { # Minimum admin_level to perform action.
'SITE_SETTINGS_UNDER_ATTACK': 3,
'SITE_CACHE_PURGE_CDN': 3,
'SITE_CACHE_DUMP_INTERNAL': 2,
'NOTIFICATIONS_ADMIN_PING': 2,
'NOTIFICATIONS_HOLE_INACTIVITY_DELETION': 2,
'NOTIFICATIONS_HOLE_CREATION': 2,
'NOTIFICATIONS_FROM_SHADOWBANNED_USERS': 3,
@ -330,6 +331,7 @@ COMMENT_BODY_HTML_LENGTH_LIMIT = 20000 # do not make larger than 20000 character
COMMENT_MAX_DEPTH = 200
TRANSFER_MESSAGE_LENGTH_LIMIT = 200 # do not make larger than 10000 characters (comment limit) without altering the table
MIN_REPOST_CHECK_URL_LENGTH = 9 # also change the constant in checkRepost() of submit.js
ADMIN_PING_TRUESCORE_MINIMUM = 500
LOGGEDIN_ACTIVE_TIME = 15 * 60
PFP_DEFAULT_MARSEY = True