diff --git a/files/helpers/config/const.py b/files/helpers/config/const.py index 74aed4939..d8749d76d 100644 --- a/files/helpers/config/const.py +++ b/files/helpers/config/const.py @@ -115,6 +115,62 @@ GIRL_PHRASES = [ "$, karen", "$ but its whatever" ] +GIRL_NAME_PREFIX = [ + 'the', + 'a', + 'another', + 'justA', + 'one', + 'that', + 'itsA', + 'theOnly' +] +GIRL_NAME_ADJECTIVE = [ + 'starry', + 'serene', + 'sweet', + 'pretty', + 'cute', + 'chonky', + 'fuzzy', + 'bitchy', + 'slutty', + 'lovely', + 'comfy', + 'hot', + 'funky', + 'polite', + 'cute', + 'sexy', + 'silver', + 'juicy', + 'magical', + 'nice', + 'normal' +] +GIRL_NAME_NOUN = [ + 'crown', + 'throne', + 'lake', + 'tree', + 'candy', + 'gal', + 'idol', + 'teddy', + 'queen', + 'girl', + 'woman', + 'lady', + 'ghost', + 'friend', + 'doll', + 'bear', + 'witch', + 'bitch', + 'duck', + 'cottage', + 'fairy', +] SLURS = { "(? 0 else "") + + if not valid_username_regex.fullmatch(new_name): + new_name = f"SomeWeirdGirl{random.randrange(100000)}" + + existing = get_user(new_name, graceful=True) + if existing and existing.id != author.id: + if len(new_name) < 23: + new_name = f"{new_name}_{random.randrange(pow(10, 23-len(new_name)))}" + else: + new_name = f"SomeQuirkyGirl{random.randrange(100000)}" + + if not author.prelock_username: + author.prelock_username = author.username + author.username = new_name + if author.misogynist and time.time() < author.misogynist: author.misogynist += 86400 else: author.misogynist = int(time.time()) + 86400 @@ -375,6 +402,10 @@ def award_thing(v, thing_type, id): author.flairchanged = int(time.time()) + 86400 badge_grant(user=author, badge_id=96) elif kind == "namelock": + + if author.misogynist: + abort(409, f"{safe_username} is under the effect of a conflicting award: Misogynist award!") + new_name = note.strip().lstrip('@') if not new_name and author.namechanged: author.namechanged += 86400 @@ -519,3 +550,4 @@ def award_thing(v, thing_type, id): g.db.add(author) return {"message": f"{AWARDS[kind]['title']} award given to {thing_type} successfully!"} + diff --git a/files/routes/settings.py b/files/routes/settings.py index cdaec5626..f3afbcee8 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -721,7 +721,7 @@ def settings_advanced_get(v:User): @limiter.limit(DEFAULT_RATELIMIT, key_func=get_ID) @is_not_permabanned def settings_name_change(v): - if v.namechanged: abort(403) + if v.namechanged or v.misogynist: abort(403) if v.shadowbanned: abort(500) diff --git a/files/templates/settings/personal.html b/files/templates/settings/personal.html index 72184bc68..a52ef0b23 100644 --- a/files/templates/settings/personal.html +++ b/files/templates/settings/personal.html @@ -163,10 +163,10 @@

Your original username will always stay reserved for you: {{v.original_username}}

- + 3-25 characters, including letters, numbers, _ , and -
- +
@@ -271,8 +271,8 @@ {% endif %} -{% if v.namechanged %} - +{% if v.namechanged or v.misogynist%} + {% endif %}