forked from MarseyWorld/MarseyWorld
add block mute expiry for rdrama
parent
ef11d5d7bb
commit
3bf846698e
|
@ -227,7 +227,36 @@ PERMS = { # Minimum admin_level to perform action.
|
|||
'INFINITE_CURRENCY': 5,
|
||||
}
|
||||
|
||||
FEATURES = {
|
||||
'MARSEYBUX': True,
|
||||
'AWARDS': True,
|
||||
'CHAT': True,
|
||||
'PINS': True,
|
||||
'PRONOUNS': False,
|
||||
'BADGES': True,
|
||||
'HATS': True,
|
||||
'HOUSES': True,
|
||||
'GAMBLING': True,
|
||||
'USERS_PROFILE_BANNER': True,
|
||||
'USERS_PROFILE_BODYTEXT': True,
|
||||
'USERS_PROFILE_SONG': True,
|
||||
'USERS_PERMANENT_WORD_FILTERS': False,
|
||||
'USERS_SUICIDE': True,
|
||||
'MARKUP_COMMANDS': True,
|
||||
'REPOST_DETECTION': True,
|
||||
'PATRON_ICONS': False,
|
||||
'EMOJI_SUBMISSIONS': True,
|
||||
'HAT_SUBMISSIONS': True,
|
||||
'NSFW_MARKING': True,
|
||||
'PING_GROUPS': True,
|
||||
'BOTS': True,
|
||||
'IP_LOGGING': False,
|
||||
'BLOCK_MUTE_EXPIRY': False,
|
||||
}
|
||||
|
||||
if SITE_NAME == 'rDrama':
|
||||
FEATURES['BLOCK_MUTE_EXPIRY'] = True
|
||||
|
||||
CURSORMARSEY_DEFAULT = True
|
||||
DEFAULT_COLOR = "ff459a"
|
||||
|
||||
|
@ -415,31 +444,6 @@ HOLE_MARSEY_URL_LENGTH = 60
|
|||
### SITE SPECIFIC CONSTANTS
|
||||
################################################################################
|
||||
|
||||
FEATURES = {
|
||||
'MARSEYBUX': True,
|
||||
'AWARDS': True,
|
||||
'CHAT': True,
|
||||
'PINS': True,
|
||||
'PRONOUNS': False,
|
||||
'BADGES': True,
|
||||
'HATS': True,
|
||||
'HOUSES': True,
|
||||
'GAMBLING': True,
|
||||
'USERS_PROFILE_BANNER': True,
|
||||
'USERS_PROFILE_BODYTEXT': True,
|
||||
'USERS_PROFILE_SONG': True,
|
||||
'USERS_PERMANENT_WORD_FILTERS': False,
|
||||
'USERS_SUICIDE': True,
|
||||
'MARKUP_COMMANDS': True,
|
||||
'REPOST_DETECTION': True,
|
||||
'PATRON_ICONS': False,
|
||||
'EMOJI_SUBMISSIONS': True,
|
||||
'HAT_SUBMISSIONS': True,
|
||||
'NSFW_MARKING': True,
|
||||
'PING_GROUPS': True,
|
||||
'BOTS': True,
|
||||
'IP_LOGGING': False,
|
||||
}
|
||||
HOUSES = ["Furry","Femboy","Vampire","Racist","Edgy"]
|
||||
|
||||
WERKZEUG_ERROR_DESCRIPTIONS = {
|
||||
|
|
|
@ -88,6 +88,10 @@ def cron_fn(every_5m, every_1d, every_1mo):
|
|||
_leaderboard_task()
|
||||
g.db.commit()
|
||||
|
||||
if FEATURES['BLOCK_MUTE_EXPIRY']:
|
||||
_expire_blocks_mutes()
|
||||
g.db.commit()
|
||||
|
||||
if every_1mo:
|
||||
_give_marseybux_salary()
|
||||
g.db.commit()
|
||||
|
@ -338,3 +342,18 @@ def _give_marseybux_salary():
|
|||
marseybux_salary = u.admin_level * 10000
|
||||
u.pay_account('marseybux', marseybux_salary)
|
||||
send_repeatable_notification(u.id, f"You have received your monthly janny salary of {marseybux_salary} Marseybux!")
|
||||
|
||||
def _expire_blocks_mutes():
|
||||
one_month_ago = time.time() - 2629800
|
||||
|
||||
blocks = g.db.query(UserBlock).filter(UserBlock.created_utc < one_month_ago)
|
||||
for block in blocks:
|
||||
send_repeatable_notification(block.user_id, f"Your block of @{block.target.username} has passed 1 month and expired!")
|
||||
send_repeatable_notification(block.target_id, f"@{block.user.username}'s block of you has passed 1 month and expired!")
|
||||
g.db.delete(block)
|
||||
|
||||
mutes = g.db.query(UserMute).filter(UserMute.created_utc < one_month_ago)
|
||||
for mute in mutes:
|
||||
send_repeatable_notification(mute.user_id, f"Your mute of @{mute.target.username} has passed 1 month and expired!")
|
||||
send_repeatable_notification(mute.target_id, f"@{mute.user.username}'s mute of you has passed 1 month and expired!")
|
||||
g.db.delete(mute)
|
||||
|
|
Loading…
Reference in New Issue