From 837000505f3a6e08b8f332f7f4bad375321da8ff Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Thu, 22 Dec 2022 00:38:12 +0200 Subject: [PATCH] remove DONT_LINK_ALTS in favor of DONT_SHADOWBAN --- files/helpers/config/const.py | 4 ++-- files/routes/routehelpers.py | 5 ++--- files/routes/users.py | 4 ---- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/files/helpers/config/const.py b/files/helpers/config/const.py index d856db284..ae24ee6fc 100644 --- a/files/helpers/config/const.py +++ b/files/helpers/config/const.py @@ -495,7 +495,7 @@ BADGE_BLACKLIST = { # only grantable by AEVANN_ID and SNAKES_ID } NOTIFIED_USERS = {} -DONT_LINK_ALTS = {} +DONT_SHADOWBAN = {} if SITE == 'rdrama.net': FEATURES['PRONOUNS'] = True @@ -572,7 +572,7 @@ if SITE == 'rdrama.net': ANTISPAM_BYPASS_IDS = {1703, 13427} - DONT_LINK_ALTS = {253,3161,11163} + DONT_SHADOWBAN = {253,3161,11163} BOOSTED_HOLES = { 'furry', diff --git a/files/routes/routehelpers.py b/files/routes/routehelpers.py index 074332407..b07633046 100644 --- a/files/routes/routehelpers.py +++ b/files/routes/routehelpers.py @@ -34,7 +34,6 @@ def check_for_alts(current:User, include_current_session=True): past_accs = set(session.get("history", [])) if include_current_session else set() def add_alt(user1:int, user2:int): - if SITE == 'rdrama.net' and (user1 in DONT_LINK_ALTS or user2 in DONT_LINK_ALTS): return li = [user1, user2] existing = g.db.query(Alt).filter(Alt.user1.in_(li), Alt.user2.in_(li)).one_or_none() if not existing: @@ -71,11 +70,11 @@ def check_for_alts(current:User, include_current_session=True): g.db.flush() for u in current.alts_unique: if u._alt_deleted: continue - if u.shadowbanned: + if u.shadowbanned and current.id not in DONT_SHADOWBAN: current.shadowbanned = u.shadowbanned current.ban_reason = u.ban_reason g.db.add(current) - elif current.shadowbanned: + elif current.shadowbanned and u.id not in DONT_SHADOWBAN: u.shadowbanned = current.shadowbanned u.ban_reason = current.ban_reason g.db.add(u) diff --git a/files/routes/users.py b/files/routes/users.py index 7d12627e9..37da76139 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -1156,9 +1156,6 @@ def subscribed_posts(v:User, username): @app.post("/fp/") @auth_required def fp(v:User, fp): - if SITE == 'rdrama.net' and v.id in DONT_LINK_ALTS: - return '', 204 - v.fp = fp users = g.db.query(User).filter(User.fp == fp, User.id != v.id).all() if users: print(f'{v.username}: fp', flush=True) @@ -1168,7 +1165,6 @@ def fp(v:User, fp): print(f'{v.username}: email', flush=True) users += alts for u in users: - if SITE == 'rdrama.net' and u.id in DONT_LINK_ALTS: continue li = [v.id, u.id] existing = g.db.query(Alt).filter(Alt.user1.in_(li), Alt.user2.in_(li)).one_or_none() if existing: continue