From c4e8755a8db35bfe29fa37c2d1c3f503f8ddc74e Mon Sep 17 00:00:00 2001 From: TLSM Date: Sun, 17 Jul 2022 23:59:20 -0400 Subject: [PATCH 01/12] LGB: const settings, welcome message. --- files/helpers/const.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/files/helpers/const.py b/files/helpers/const.py index db685dba3..9931ca6a4 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -210,6 +210,8 @@ if SITE in ('rdrama.net', 'devrama.xyz'): elif SITE == 'deuxrama.net': SIDEBAR_THREAD = 175 BADGE_THREAD = 142 +elif SITE == 'lgbdropthet.com': + GAMBLING_THREAD = 25 if SITE in {'rdrama.net', 'devrama.xyz', 'deuxrama.net'}: HOLE_COST = 50000 @@ -319,6 +321,8 @@ elif SITE == 'lgbdropthet.com': AEVANN_ID = 10 SNAKES_ID = 9 + WELCOME_MSG = "**Welcome to LGBDropTheT!**\n\nWe are a community of gay, lesbian, and bisexual men and women (and our allies) who believe that the LGB community should separate from the Transgender and Queer+ communities. \n\nWe believe sexuality and gender identity are distinct and unrelated concepts, and that the interests and goals of our communities are misrepresented by grouping our experiences and politics as one. LGB and TQ+ both deserve a supportive community, but neither one should be at the expense of the other. We feel our rights and protections are under attack due to the Transgender and Queer+ movements silencing and condemning our beliefs. \n\nWe believe that men are adult human males and women are adult human females. Our orientations are based towards an individual's sex, not gender identity. The same organizations and communities that we created in order to solidify ourselves now label us as \"phobic\", \"preferential\", or \"genital fetishists\". The TQ+ dogma and rhetoric are coercing gay men, lesbians, and bisexuals to suppress same-sex attraction in favor of fluidity and non-distinction of the opposite sex. Our gender non-conforming LGB youth are being taught that they're born in the wrong body, and persuaded to take life-altering medications to correct their \"sex assigned at birth\". \n\nThis is nothing more than homophobia and conversion therapy disguised as progress. \n\nIt's time to reclaim our organizations and movement by and for our own people. We want to \"Drop The T\" and all the letters after it, and ensure that the needs of lesbians, gay men, and bisexuals are centered once-again. \n\n* If you're new to our movement and how we operate, we recommend starting with our **[Rules and FAQs](https://lgbdropthet/kb/rulesfaqs)** to better understand our community guidelines. \n\n* To familiarize yourself with how the site works, we recommend visiting our **[Help and Support](https://lgbdropthet.com/h/help_and_support)** community. Feel free to make a test post of your own there so you can get used to using the features - you can always delete your post later. \n\n* Feeling a little overwhelmed and don't know where to start? Consider introducing yourself in our **[Off-Topic / Social](https://lgbdropthet.com/h/off_topic_social)** community. \n\nThank you for being a part of our growing movement, we look forward to seeing you! \n\n**~ The LGBDropTheT team**" + LOTTERY_ENABLED = False else: # localhost or testing environment implied pass From f72fcd00b95ccc3654bd66356da3ddf6ceea06a1 Mon Sep 17 00:00:00 2001 From: TLSM Date: Mon, 18 Jul 2022 00:34:55 -0400 Subject: [PATCH 02/12] LGB: emoji content. --- files/assets/emojis.json | 1 + files/assets/emojis.lgbdropthet.json | 3 ++- files/assets/images/emojis/pedobear.webp | Bin 0 -> 6218 bytes 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 files/assets/images/emojis/pedobear.webp diff --git a/files/assets/emojis.json b/files/assets/emojis.json index 8d1e8de3e..c08a95f63 100644 --- a/files/assets/emojis.json +++ b/files/assets/emojis.json @@ -839,6 +839,7 @@ {"name":"gigachad","tags": ["chad"],"class":"Misc"}, {"name":"gigachad2", "tags": ["chad"], "class":"Misc"}, {"name":"gigachad3", "tags": ["chad"], "class":"Misc"}, + {"name":"pedobear", "class":"Misc"}, {"name":"kippy","class":"Misc"}, {"name":"onerat","class":"Misc"}, {"name":"gunt","class":"Misc"} diff --git a/files/assets/emojis.lgbdropthet.json b/files/assets/emojis.lgbdropthet.json index c0924615d..6ae21957a 100644 --- a/files/assets/emojis.lgbdropthet.json +++ b/files/assets/emojis.lgbdropthet.json @@ -378,5 +378,6 @@ {"name":"wholesomeseal","class":"Misc"}, {"name":"gigachadglow","tags": ["chad", "glow", "fbi"],"class":"Misc"}, {"name":"gigachad","tags": ["chad"],"class":"Misc"}, - {"name":"gigachad2", "tags": ["chad"], "class":"Misc"} + {"name":"gigachad2", "tags": ["chad"], "class":"Misc"}, + {"name":"pedobear", "class":"Misc"} ] diff --git a/files/assets/images/emojis/pedobear.webp b/files/assets/images/emojis/pedobear.webp new file mode 100644 index 0000000000000000000000000000000000000000..dd797e5749a33d482e7a1bf3e341aedb0c33a773 GIT binary patch literal 6218 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 Date: Mon, 18 Jul 2022 00:37:07 -0400 Subject: [PATCH 03/12] LGB: add modlog link to admin_home template. --- files/templates/admin/admin_home.html | 1 + 1 file changed, 1 insertion(+) diff --git a/files/templates/admin/admin_home.html b/files/templates/admin/admin_home.html index 1a026e238..f303a7f38 100644 --- a/files/templates/admin/admin_home.html +++ b/files/templates/admin/admin_home.html @@ -12,6 +12,7 @@

Content

    +
  • Moderation Log
  • Image Posts
  • Reported Posts/Comments
  • Removed Posts/Comments
  • From 8f7d05d62dbe36af394a74137ce3727faa618d05 Mon Sep 17 00:00:00 2001 From: TLSM Date: Mon, 18 Jul 2022 01:10:01 -0400 Subject: [PATCH 04/12] Refactor feature flags to dict. In anticipation of adding about a dozen more features flags to support work for LGB, PIN_ENABLED and PROCOINS_ENABLED have been moved to the FEATURES dict in const.py. More generally looking to create a unified interface for logically-related constants, perhaps to support e.g. later moving these settings from hardcoded constants to data. --- files/helpers/actions.py | 2 +- files/helpers/const.py | 15 ++++++++++----- files/helpers/jinja2.py | 7 ++++--- files/routes/admin.py | 2 +- files/routes/awards.py | 4 ++-- files/routes/comments.py | 4 ++-- files/templates/header.html | 4 ++-- files/templates/shop.html | 2 +- files/templates/userpage.html | 8 ++++---- 9 files changed, 27 insertions(+), 21 deletions(-) diff --git a/files/helpers/actions.py b/files/helpers/actions.py index d150167a2..418a19a6c 100644 --- a/files/helpers/actions.py +++ b/files/helpers/actions.py @@ -152,7 +152,7 @@ def execute_snappy(post, v): if body.startswith('!slots'): check_for_slots_command(body, snappy, c) - if PIN_ENABLED and (body.startswith(':#marseypin:') or body.startswith(':#marseypin2:')): + if FEATURES['PINS'] and (body.startswith(':#marseypin:') or body.startswith(':#marseypin2:')): post.stickied = "Snappy" post.stickied_utc = int(time.time()) + 3600 diff --git a/files/helpers/const.py b/files/helpers/const.py index 9931ca6a4..47c0f3231 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -139,11 +139,14 @@ PERMS = { # Minimum admin_level to perform action. 'CONTENT_THREADS': 3, } +FEATURES = { + 'PROCOINS': True, + 'PINS': True, +} + EMOJI_MARSEYS = True EMOJI_SRCS = ['files/assets/emojis.json'] -PROCOINS_ENABLED = True -PIN_ENABLED = True PIN_LIMIT = 3 POST_RATE_LIMIT = '1/second;2/minute;10/hour;50/day' LOGGEDIN_ACTIVE_TIME = 15 * 60 @@ -287,7 +290,8 @@ elif SITE == 'watchpeopledie.co': PERMS['HOLE_CREATE'] = 2 PERMS['FLAGS_VISIBLE'] = 2 - PROCOINS_ENABLED = False + FEATURES['PROCOINS'] = False + HOLE_NAME = 'flair' HOLE_STYLE_FLAIR = True HOLE_REQUIRED = True @@ -305,10 +309,11 @@ elif SITE == 'lgbdropthet.com': PERMS['HOLE_CREATE'] = 3 PERMS['FLAGS_VISIBLE_REPORTER'] = 2 + FEATURES['PROCOINS'] = False + EMOJI_MARSEYS = False EMOJI_SRCS = ['files/assets/emojis.lgbdropthet.json'] - PROCOINS_ENABLED = False PFP_DEFAULT_MARSEY = False HOLE_NAME = 'community' @@ -758,7 +763,7 @@ if SITE == 'pcmemes.net': AWARDS_DISABLED.remove('ghost') elif SITE_NAME == 'WPD': AWARDS_DISABLED.remove('lootbox') -if not PROCOINS_ENABLED: +if not FEATURES['PROCOINS']: AWARDS_DISABLED.append('benefactor') AWARDS2 = {x: AWARDS[x] for x in AWARDS if x not in AWARDS_DISABLED} diff --git a/files/helpers/jinja2.py b/files/helpers/jinja2.py index 03fc5b004..54b9b9686 100644 --- a/files/helpers/jinja2.py +++ b/files/helpers/jinja2.py @@ -53,8 +53,9 @@ def inject_constants(): "AUTOJANNY_ID":AUTOJANNY_ID, "PUSHER_ID":PUSHER_ID, "CC":CC, "CC_TITLE":CC_TITLE, "listdir":listdir, "MOOSE_ID":MOOSE_ID, "AEVANN_ID":AEVANN_ID, "PIZZASHILL_ID":PIZZASHILL_ID, "DEFAULT_COLOR":DEFAULT_COLOR, - "COLORS":COLORS, "time":time, + "COLORS":COLORS, "time":time, "PERMS": PERMS, "FEATURES": FEATURES, "HOLE_NAME": HOLE_NAME, "HOLE_STYLE_FLAIR": HOLE_STYLE_FLAIR, "HOLE_REQUIRED": HOLE_REQUIRED, "LOTTERY_ENABLED": LOTTERY_ENABLED, "GUMROAD_LINK": GUMROAD_LINK, - "DEFAULT_THEME": DEFAULT_THEME, "DESCRIPTION": DESCRIPTION, "PERMS": PERMS, - "PROCOINS_ENABLED": PROCOINS_ENABLED, "has_sidebar": has_sidebar, "has_logo": has_logo, "FP": FP, "NOTIF_MODACTION_JL_MIN": NOTIF_MODACTION_JL_MIN} + "DEFAULT_THEME": DEFAULT_THEME, "DESCRIPTION": DESCRIPTION, + "has_sidebar": has_sidebar, "has_logo": has_logo, + "FP": FP, "NOTIF_MODACTION_JL_MIN": NOTIF_MODACTION_JL_MIN} diff --git a/files/routes/admin.py b/files/routes/admin.py index d2c468812..c9e4040a8 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -1196,7 +1196,7 @@ def api_distinguish_post(post_id, v): @app.post("/sticky/") @admin_level_required(2) def sticky_post(post_id, v): - if not PIN_ENABLED: + if not FEATURES['PINS']: abort(403) post = get_post(post_id) diff --git a/files/routes/awards.py b/files/routes/awards.py index 417eb03e1..3bd22e676 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -199,7 +199,7 @@ def award_thing(v, thing_type, id): if note: text += f" ({note})" notify_mod_action(v.id, text) elif kind == "pin": - if not PIN_ENABLED: + if not FEATURES['PINS']: abort(403) if thing.stickied and thing.stickied_utc: thing.stickied_utc += 3600 @@ -275,7 +275,7 @@ def award_thing(v, thing_type, id): author.fish = True badge_grant(badge_id=90, user=author) elif kind == "progressivestack": - if not PIN_ENABLED: + if not FEATURES['PINS']: abort(403) if author.progressivestack: author.progressivestack += 21600 else: author.progressivestack = int(time.time()) + 21600 diff --git a/files/routes/comments.py b/files/routes/comments.py index 39f8931fc..5db2cb83c 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -846,7 +846,7 @@ def undelete_comment(cid, v): @app.post("/pin_comment/") @auth_required def pin_comment(cid, v): - if not PIN_ENABLED: + if not FEATURES['PINS']: abort(403) comment = get_comment(cid, v=v) @@ -890,7 +890,7 @@ def unpin_comment(cid, v): @app.post("/mod_pin/") @auth_required def mod_pin(cid, v): - if not PIN_ENABLED: + if not FEATURES['PINS']: abort(403) comment = get_comment(cid, v=v) diff --git a/files/templates/header.html b/files/templates/header.html index d829e4dc6..ad085aba9 100644 --- a/files/templates/header.html +++ b/files/templates/header.html @@ -207,8 +207,8 @@
    {{v.username}}
    -
    coins{{v.coins}}{% if not PROCOINS_ENABLED %} Coin{{ help.plural(v.coins) }}{% endif %}
    - {% if PROCOINS_ENABLED %} +
    coins{{v.coins}}{% if not FEATURES['PROCOINS'] %} Coin{{ help.plural(v.coins) }}{% endif %}
    + {% if FEATURES['PROCOINS'] %}
    marseybux{{v.procoins}}
    {% endif %}
    diff --git a/files/templates/shop.html b/files/templates/shop.html index 2c9c97354..5c328b8d7 100644 --- a/files/templates/shop.html +++ b/files/templates/shop.html @@ -24,7 +24,7 @@
    Coins spent by you: {{v.coins_spent}} coins
    Lootboxes bought by you: {{v.lootboxes_bought}} lootbox{{'es' if v.lootboxes_bought != 1}}
    Your current coins: {{v.coins}}
    - {% if PROCOINS_ENABLED %} + {% if FEATURES['PROCOINS'] %}
    Your current marseybux: {{v.procoins}}
    {% endif %} diff --git a/files/templates/userpage.html b/files/templates/userpage.html index 145635318..de1f01b98 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -121,7 +121,7 @@ {{u.coins}} coins   - {% if PROCOINS_ENABLED %} + {% if FEATURES['PROCOINS'] %} {{u.procoins}} marseybux   {% endif %} @@ -189,7 +189,7 @@ Get them help Gift coins - {% if PROCOINS_ENABLED %} + {% if FEATURES['PROCOINS'] %} Gift Marseybux {% endif %} @@ -432,7 +432,7 @@ {{u.coins}} coins   - {% if PROCOINS_ENABLED %} + {% if FEATURES['PROCOINS'] %} {{u.procoins}} marseybux   {% endif %} @@ -513,7 +513,7 @@ Message Get them help Gift coins - {% if PROCOINS_ENABLED %} + {% if FEATURES['PROCOINS'] %} Gift Marseybux {% endif %} From 0c43deeee64b260bf2f59af98af84ef7c60d1b66 Mon Sep 17 00:00:00 2001 From: TLSM Date: Mon, 18 Jul 2022 02:43:20 -0400 Subject: [PATCH 05/12] FEATURES: pronouns, kys, chat, house, /vote perm. --- files/helpers/const.py | 16 +++++++++++-- files/helpers/stats.py | 2 +- files/routes/settings.py | 4 +++- files/routes/users.py | 3 +++ files/routes/votes.py | 4 ++-- files/templates/comments.html | 8 +++---- files/templates/header.html | 2 ++ files/templates/mobile_navigation_bar.html | 2 ++ files/templates/post_actions.html | 2 +- files/templates/post_actions_mobile.html | 2 +- files/templates/settings_profile.html | 4 ++-- files/templates/submission.html | 4 ++-- files/templates/submission_listing.html | 4 ++-- files/templates/userpage.html | 28 ++++++++++++---------- 14 files changed, 55 insertions(+), 30 deletions(-) diff --git a/files/helpers/const.py b/files/helpers/const.py index 47c0f3231..7f2d61a92 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -133,15 +133,20 @@ AGENDAPOSTER_MSG_HTML = """

    Hi week).count(), } - if site == 'rDrama': + if site == 'rDrama' or FEATURES['HOUSES']: stats2 = { "House furry members": g.db.query(User).filter(User.house.like('Furry%')).count(), "House femboy members": g.db.query(User).filter(User.house.like('Femboy%')).count(), diff --git a/files/routes/settings.py b/files/routes/settings.py index 978ac64c9..24f65a49c 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -260,7 +260,7 @@ def settings_profile_post(v): else: abort(400) house = request.values.get("house") - if house and house in ("None","Furry","Femboy","Vampire","Racist"): + if house and house in ("None","Furry","Femboy","Vampire","Racist") and FEATURES['HOUSES']: if v.house: cost = 2000 else: cost = 500 @@ -877,6 +877,8 @@ def settings_title_change(v): @limiter.limit("1/second;30/minute;200/hour;1000/day", key_func=lambda:f'{SITE}-{session.get("lo_user")}') @auth_required def settings_pronouns_change(v): + if not FEATURES['PRONOUNS']: + abort(403) pronouns = request.values.get("pronouns").replace("𒐪","").lower().strip() diff --git a/files/routes/users.py b/files/routes/users.py index b946144d4..7e4dd837f 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -376,6 +376,9 @@ def downvoting(v, username): @limiter.limit("1/second;5/day", key_func=lambda:f'{SITE}-{session.get("lo_user")}') @auth_required def suicide(v, username): + if not FEATURES['USERS_SUICIDE']: + abort(403) + user = get_user(username) suicide = f"Hi there,\n\nA [concerned user](/id/{v.id}) reached out to us about you.\n\nWhen you're in the middle of something painful, it may feel like you don't have a lot of options. But whatever you're going through, you deserve help and there are people who are here for you.\n\nThere are resources available in your area that are free, confidential, and available 24/7:\n\n- Call, Text, or Chat with Canada's [Crisis Services Canada](https://www.crisisservicescanada.ca/en/)\n- Call, Email, or Visit the UK's [Samaritans](https://www.samaritans.org/)\n- Text CHAT to America's [Crisis Text Line](https://www.crisistextline.org/) at 741741.\nIf you don't see a resource in your area above, the moderators keep a comprehensive list of resources and hotlines for people organized by location. Find Someone Now\n\nIf you think you may be depressed or struggling in another way, don't ignore it or brush it aside. Take yourself and your feelings seriously, and reach out to someone.\n\nIt may not feel like it, but you have options. There are people available to listen to you, and ways to move forward.\n\nYour fellow users care about you and there are people who want to help." if not v.shadowbanned: diff --git a/files/routes/votes.py b/files/routes/votes.py index efb15f62c..d198c4fe3 100644 --- a/files/routes/votes.py +++ b/files/routes/votes.py @@ -6,7 +6,7 @@ from flask import * from files.__main__ import app, limiter, cache @app.get("/votes/") -@auth_required +@admin_level_required(PERMS['VOTES_VISIBLE']) def vote_info_get(v, link): try: if "t2_" in link: thing = get_post(int(link.split("t2_")[1]), v=v) @@ -199,4 +199,4 @@ def api_vote_comment(comment_id, new, v): comment.realupvotes = g.db.query(CommentVote).filter_by(comment_id=comment.id, real=True).count() if comment.author.progressivestack: comment.realupvotes *= 2 g.db.add(comment) - return "", 204 \ No newline at end of file + return "", 204 diff --git a/files/templates/comments.html b/files/templates/comments.html index 3103a9713..176b233e7 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -192,7 +192,7 @@ {% if c.ghost %} 👻 {% else %} - {% if SITE_NAME=='rDrama' and c.author.house %} + {% if FEATURES['HOUSES'] and c.author.house %} House {{c.author.house}} {% endif %} @@ -206,7 +206,7 @@ {% endif %} {{c.author_name}} - {% if SITE_NAME == 'rDrama' %} + {% if FEATURES['PRONOUNS'] %} {{c.author.pronouns}} {% endif %} {% if c.author.customtitle %} @@ -437,7 +437,7 @@ {% endif %} - {% if not c.ghost or v.id == AEVANN_ID %}Votes{% endif %} + {% if v and ((not c.ghost and v.admin_level >= PERMS['VOTES_VISIBLE']) or v.id == AEVANN_ID) %}Votes{% endif %} Context @@ -644,7 +644,7 @@

    - {% if SITE_NAME == 'rDrama' %} + {% if FEATURES['PRONOUNS'] %}

    {{u.pronouns}}

    {% endif %} @@ -187,11 +187,13 @@ Follow Message - Get them help - Gift coins - {% if FEATURES['PROCOINS'] %} + {% if FEATURES['USERS_SUICIDE'] -%} + Get Them Help + {%- endif %} + Gift Coins + {% if FEATURES['PROCOINS'] -%} Gift Marseybux - {% endif %} + {%- endif %} Block @@ -399,7 +401,7 @@ {% endif %} - {% if SITE_NAME=='rDrama' and u.house %} + {% if FEATURES['HOUSES'] and u.house %} House {{u.house}} {% endif %} @@ -416,7 +418,7 @@ Follows you {% endif %} - {% if SITE_NAME == 'rDrama' %} + {% if FEATURES['PRONOUNS'] %}

    {{u.pronouns}}

    {% endif %} @@ -511,11 +513,13 @@ Follow Message - Get them help - Gift coins - {% if FEATURES['PROCOINS'] %} + {% if FEATURES['USERS_SUICIDE'] -%} + Get Them Help + {%- endif %} + Gift Coins + {% if FEATURES['PROCOINS'] -%} Gift Marseybux - {% endif %} + {%- endif %} Block From eef6c25b0b41ef259f1239db980abe67a0b90d2a Mon Sep 17 00:00:00 2001 From: TLSM Date: Mon, 18 Jul 2022 03:17:45 -0400 Subject: [PATCH 06/12] LGB: Permission block, follow, voters visibility. --- files/helpers/const.py | 6 ++++++ files/routes/static.py | 2 +- files/routes/users.py | 22 ++++++++++++++++++++++ files/templates/settings2.html | 2 ++ files/templates/userpage.html | 4 ++++ 5 files changed, 35 insertions(+), 1 deletion(-) diff --git a/files/helpers/const.py b/files/helpers/const.py index 7f2d61a92..1ff146e5f 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -138,6 +138,9 @@ PERMS = { # Minimum admin_level to perform action. 'FLAGS_VISIBLE_REPORTER': 0, 'FLAGS_REMOVE': 2, 'VOTES_VISIBLE': 0, + 'USER_BLOCKS_VISIBLE': 0, + 'USER_FOLLOWS_VISIBLE': 0, + 'USER_VOTERS_VISIBLE': 0, } FEATURES = { @@ -317,6 +320,9 @@ elif SITE == 'lgbdropthet.com': PERMS['HOLE_CREATE'] = 3 PERMS['FLAGS_VISIBLE_REPORTER'] = 2 PERMS['VOTES_VISIBLE'] = 2 + PERMS['USER_BLOCKS_VISIBLE'] = 2 + PERMS['USER_FOLLOWS_VISIBLE'] = 2 + PERMS['USER_VOTERS_VISIBLE'] = 2 FEATURES['PROCOINS'] = False FEATURES['CHAT'] = False diff --git a/files/routes/static.py b/files/routes/static.py index 928056b6c..3089848a0 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -327,7 +327,7 @@ def badges(v): return render_template("badges.html", v=v, badges=badges, counts=counts) @app.get("/blocks") -@auth_required +@admin_level_required(PERMS['USER_BLOCKS_VISIBLE']) def blocks(v): diff --git a/files/routes/users.py b/files/routes/users.py index 7e4dd837f..efbd3bd59 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -62,6 +62,7 @@ gevent.spawn(leaderboard_thread()) def upvoters_posts(v, username, uid): u = get_user(username) if u.is_private and (not v or (v.id != u.id and v.admin_level < 2 and not v.eye)): abort(403) + if not (v.id == u.id or v.admin_level >= PERMS['USER_VOTERS_VISIBLE']): abort(403) id = u.id uid = int(uid) @@ -83,6 +84,7 @@ def upvoters_posts(v, username, uid): def upvoters_comments(v, username, uid): u = get_user(username) if u.is_private and (not v or (v.id != u.id and v.admin_level < 2 and not v.eye)): abort(403) + if not (v.id == u.id or v.admin_level >= PERMS['USER_VOTERS_VISIBLE']): abort(403) id = u.id uid = int(uid) @@ -104,6 +106,7 @@ def upvoters_comments(v, username, uid): def downvoters_posts(v, username, uid): u = get_user(username) if u.is_private and (not v or (v.id != u.id and v.admin_level < 2 and not v.eye)): abort(403) + if not (v.id == u.id or v.admin_level >= PERMS['USER_VOTERS_VISIBLE']): abort(403) id = u.id uid = int(uid) @@ -125,6 +128,7 @@ def downvoters_posts(v, username, uid): def downvoters_comments(v, username, uid): u = get_user(username) if u.is_private and (not v or (v.id != u.id and v.admin_level < 2 and not v.eye)): abort(403) + if not (v.id == u.id or v.admin_level >= PERMS['USER_VOTERS_VISIBLE']): abort(403) id = u.id uid = int(uid) @@ -149,6 +153,7 @@ def downvoters_comments(v, username, uid): def upvoting_posts(v, username, uid): u = get_user(username) if u.is_private and (not v or (v.id != u.id and v.admin_level < 2 and not v.eye)): abort(403) + if not (v.id == u.id or v.admin_level >= PERMS['USER_VOTERS_VISIBLE']): abort(403) id = u.id uid = int(uid) @@ -170,6 +175,7 @@ def upvoting_posts(v, username, uid): def upvoting_comments(v, username, uid): u = get_user(username) if u.is_private and (not v or (v.id != u.id and v.admin_level < 2 and not v.eye)): abort(403) + if not (v.id == u.id or v.admin_level >= PERMS['USER_VOTERS_VISIBLE']): abort(403) id = u.id uid = int(uid) @@ -191,6 +197,7 @@ def upvoting_comments(v, username, uid): def downvoting_posts(v, username, uid): u = get_user(username) if u.is_private and (not v or (v.id != u.id and v.admin_level < 2 and not v.eye)): abort(403) + if not (v.id == u.id or v.admin_level >= PERMS['USER_VOTERS_VISIBLE']): abort(403) id = u.id uid = int(uid) @@ -212,6 +219,7 @@ def downvoting_posts(v, username, uid): def downvoting_comments(v, username, uid): u = get_user(username) if u.is_private and (not v or (v.id != u.id and v.admin_level < 2 and not v.eye)): abort(403) + if not (v.id == u.id or v.admin_level >= PERMS['USER_VOTERS_VISIBLE']): abort(403) id = u.id uid = int(uid) @@ -255,6 +263,8 @@ def agendaposters(v): @auth_required def upvoters(v, username): id = get_user(username).id + if not (v.id == id or v.admin_level >= PERMS['USER_VOTERS_VISIBLE']): + abort(403) votes = g.db.query(Vote.user_id, func.count(Vote.user_id)).join(Submission).filter(Submission.ghost == False, Submission.is_banned == False, Submission.deleted_utc == 0, Vote.vote_type==1, Submission.author_id==id).group_by(Vote.user_id).order_by(func.count(Vote.user_id).desc()).all() @@ -286,6 +296,8 @@ def upvoters(v, username): @auth_required def downvoters(v, username): id = get_user(username).id + if not (v.id == id or v.admin_level >= PERMS['USER_VOTERS_VISIBLE']): + abort(403) votes = g.db.query(Vote.user_id, func.count(Vote.user_id)).join(Submission).filter(Submission.ghost == False, Submission.is_banned == False, Submission.deleted_utc == 0, Vote.vote_type==-1, Submission.author_id==id).group_by(Vote.user_id).order_by(func.count(Vote.user_id).desc()).all() @@ -315,6 +327,8 @@ def downvoters(v, username): @auth_required def upvoting(v, username): id = get_user(username).id + if not (v.id == id or v.admin_level >= PERMS['USER_VOTERS_VISIBLE']): + abort(403) votes = g.db.query(Submission.author_id, func.count(Submission.author_id)).join(Vote).filter(Submission.ghost == False, Submission.is_banned == False, Submission.deleted_utc == 0, Vote.vote_type==1, Vote.user_id==id).group_by(Submission.author_id).order_by(func.count(Submission.author_id).desc()).all() @@ -344,6 +358,8 @@ def upvoting(v, username): @auth_required def downvoting(v, username): id = get_user(username).id + if not (v.id == id or v.admin_level >= PERMS['USER_VOTERS_VISIBLE']): + abort(403) votes = g.db.query(Submission.author_id, func.count(Submission.author_id)).join(Vote).filter(Submission.ghost == False, Submission.is_banned == False, Submission.deleted_utc == 0, Vote.vote_type==-1, Vote.user_id==id).group_by(Submission.author_id).order_by(func.count(Submission.author_id).desc()).all() @@ -857,6 +873,9 @@ def redditor_moment_redirect(username, v): @auth_required def followers(username, v): u = get_user(username, v=v) + if not (v.id == u.id or v.admin_level >= PERMS['USER_FOLLOWS_VISIBLE']): + abort(403) + users = g.db.query(User).join(Follow, Follow.target_id == u.id) \ .filter(Follow.user_id == User.id) \ .order_by(Follow.created_utc).all() @@ -866,6 +885,9 @@ def followers(username, v): @auth_required def following(username, v): u = get_user(username, v=v) + if not (v.id == u.id or v.admin_level >= PERMS['USER_FOLLOWS_VISIBLE']): + abort(403) + users = g.db.query(User).join(Follow, Follow.user_id == u.id) \ .filter(Follow.target_id == User.id) \ .order_by(Follow.created_utc).all() diff --git a/files/templates/settings2.html b/files/templates/settings2.html index 02e8d69ab..14c2bcc5a 100644 --- a/files/templates/settings2.html +++ b/files/templates/settings2.html @@ -74,9 +74,11 @@ + {% if v and v.admin_level >= PERMS['USER_BLOCKS_VISIBLE'] -%} + {%- endif %} diff --git a/files/templates/userpage.html b/files/templates/userpage.html index 9faa83cc9..9bea79732 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -115,7 +115,9 @@
    
     				{% endif %}
     				
    +				{% if v and (v.id == u.id or v.admin_level >= PERMS['USER_VOTERS_VISIBLE']) -%}
     				
    +				{%- endif %}
     
     				
    {{u.coins}} @@ -428,7 +430,9 @@
    
     				{% endif %}
     
    +				{% if v and (v.id == u.id or v.admin_level >= PERMS['USER_VOTERS_VISIBLE']) -%}
     				
    +				{%- endif %}
     
     				
    {{u.coins}} From 9d036441e7567903fb38289f9f8565cd7fead047 Mon Sep 17 00:00:00 2001 From: TLSM Date: Mon, 18 Jul 2022 03:32:26 -0400 Subject: [PATCH 07/12] LGB: Hide donation in all contexts. Additionally, refactors some instances of `SITE_NAME != 'WPD'` to use `FEATURES['PROCOINS']` as appropriate. --- files/templates/errors/patron.html | 2 ++ files/templates/formatting.html | 4 ++-- files/templates/header.html | 4 ++-- files/templates/settings_security.html | 4 ++-- files/templates/shop.html | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/files/templates/errors/patron.html b/files/templates/errors/patron.html index 9710d443a..23422828f 100644 --- a/files/templates/errors/patron.html +++ b/files/templates/errors/patron.html @@ -13,7 +13,9 @@ :#marseymerchant:

    401 Not Authorized

    This page is only available to {% if SITE_NAME == 'rDrama' %}paypigs{% else %}patrons{% endif %}:

    + {% if FEATURES['PROCOINS'] -%} {{GUMROAD_LINK}} + {%- endif %}
    diff --git a/files/templates/formatting.html b/files/templates/formatting.html index 37f1b0f60..474c6abb9 100644 --- a/files/templates/formatting.html +++ b/files/templates/formatting.html @@ -603,7 +603,7 @@ line breaks !slots100 Play slots using coins - minimum 100 coins - {% if SITE_NAME != 'WPD' %} + {% if FEATURES['PROCOINS'] %} !slotsmb100 Play slots using marseybux - minimum 100 marseybux @@ -613,7 +613,7 @@ line breaks !blackjack100 Play blackjack using coins - minimum 100 coins - {% if SITE_NAME != 'WPD' %} + {% if FEATURES['PROCOINS'] %} !blackjackmb100 Play blackjack using marseybux - minimum 100 marseybux diff --git a/files/templates/header.html b/files/templates/header.html index ea0ba88be..ddd731d9f 100644 --- a/files/templates/header.html +++ b/files/templates/header.html @@ -240,7 +240,7 @@ Discord Fediverse {% endif %} - {% if SITE_NAME != 'WPD' %} + {% if FEATURES['PROCOINS'] %} Donate {% endif %} {% if SITE_NAME == 'rDrama' %} @@ -299,7 +299,7 @@ Discord Fediverse {% endif %} - {% if SITE_NAME != 'WPD' %} + {% if FEATURES['PROCOINS'] %} Donate {% endif %} {% if SITE_NAME == 'rDrama' %}Archives{% endif %} diff --git a/files/templates/settings_security.html b/files/templates/settings_security.html index b710a8878..b410bb286 100644 --- a/files/templates/settings_security.html +++ b/files/templates/settings_security.html @@ -44,7 +44,7 @@ diff --git a/files/templates/shop.html b/files/templates/shop.html index 5c328b8d7..a85a69bda 100644 --- a/files/templates/shop.html +++ b/files/templates/shop.html @@ -84,7 +84,7 @@ {% set kind = a['kind'] %} {% if a['kind'] != "benefactor" %}Buy{% endif %} - {% if SITE_NAME != 'WPD' %} + {% if FEATURES['PROCOINS'] %} {% if a['kind'] != "grass" %}Buy with MBux{% endif %} {% endif %} From be983504b7037d4a1ff7fd8d16a69950e008869c Mon Sep 17 00:00:00 2001 From: TLSM Date: Mon, 18 Jul 2022 03:47:17 -0400 Subject: [PATCH 08/12] LGB: disable gambling. --- files/helpers/blackjack.py | 2 +- files/helpers/const.py | 4 ++++ files/helpers/slots.py | 2 +- files/helpers/treasure.py | 2 +- files/templates/formatting.html | 32 +++++++++++++++++--------------- 5 files changed, 24 insertions(+), 18 deletions(-) diff --git a/files/helpers/blackjack.py b/files/helpers/blackjack.py index c0c753059..49d75908a 100644 --- a/files/helpers/blackjack.py +++ b/files/helpers/blackjack.py @@ -51,7 +51,7 @@ def format_all(player_hand, dealer_hand, deck, status, wager, kind, is_insured=0 def check_for_blackjack_commands(in_text, from_user, from_comment): - if not from_user.can_gamble: + if not FEATURES['GAMBLING'] or not from_user.can_gamble: return for command_word in (coins_command_word, marseybux_command_word): diff --git a/files/helpers/const.py b/files/helpers/const.py index 1ff146e5f..260c0c78a 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -150,6 +150,7 @@ FEATURES = { 'PRONOUNS': False, 'HOUSES': False, 'USERS_SUICIDE': True, + 'GAMBLING': True, } EMOJI_MARSEYS = True @@ -327,6 +328,7 @@ elif SITE == 'lgbdropthet.com': FEATURES['PROCOINS'] = False FEATURES['CHAT'] = False FEATURES['USERS_SUICIDE'] = False + FEATURES['GAMBLING'] = False EMOJI_MARSEYS = False EMOJI_SRCS = ['files/assets/emojis.lgbdropthet.json'] @@ -350,6 +352,8 @@ else: # localhost or testing environment implied FEATURES['PRONOUNS'] = True FEATURES['HOUSES'] = True + FEATURES['GAMBLING'] = False + if SITE == 'deuxrama.net': PERMS['HOLE_CREATE'] = 3 PERMS['CONTENT_THREADS'] = 2 diff --git a/files/helpers/slots.py b/files/helpers/slots.py index 55a0c0078..cc75bf275 100644 --- a/files/helpers/slots.py +++ b/files/helpers/slots.py @@ -19,7 +19,7 @@ def shuffle(stuff): return stuff def check_for_slots_command(in_text, from_user, from_comment): - if not from_user.can_gamble: + if not FEATURES['GAMBLING'] or not from_user.can_gamble: return in_text = in_text.lower() diff --git a/files/helpers/treasure.py b/files/helpers/treasure.py index 2c23e76a3..ad29855f7 100644 --- a/files/helpers/treasure.py +++ b/files/helpers/treasure.py @@ -12,7 +12,7 @@ lotterizer_rate = 33 def check_for_treasure(in_text, from_comment): user = from_comment.author - if not user.can_gamble: + if not FEATURES['GAMBLING'] or not user.can_gamble: return if '!slots' not in in_text and '!blackjack' not in in_text and '!wordle' not in in_text: diff --git a/files/templates/formatting.html b/files/templates/formatting.html index 474c6abb9..248d0acb6 100644 --- a/files/templates/formatting.html +++ b/files/templates/formatting.html @@ -599,25 +599,27 @@ line breaks - - !slots100 - Play slots using coins - minimum 100 coins - - {% if FEATURES['PROCOINS'] %} + {% if FEATURES['GAMBLING'] %} - !slotsmb100 - Play slots using marseybux - minimum 100 marseybux + !slots100 + Play slots using coins - minimum 100 coins - {% endif %} - - !blackjack100 - Play blackjack using coins - minimum 100 coins - - {% if FEATURES['PROCOINS'] %} + {% if FEATURES['PROCOINS'] %} + + !slotsmb100 + Play slots using marseybux - minimum 100 marseybux + + {% endif %} - !blackjackmb100 - Play blackjack using marseybux - minimum 100 marseybux + !blackjack100 + Play blackjack using coins - minimum 100 coins + {% if FEATURES['PROCOINS'] %} + + !blackjackmb100 + Play blackjack using marseybux - minimum 100 marseybux + + {% endif %} {% endif %} !wordle From d8d1fa3213afe587f3de47d00731849c870bf768 Mon Sep 17 00:00:00 2001 From: TLSM Date: Mon, 18 Jul 2022 03:53:50 -0400 Subject: [PATCH 09/12] Show 'Remove Mod' to JL3. Initially requested by LGB. However, extended to all sites for consistency: JL3s can add mods to any hole, so removal of mods seems symmetrically permitted. The one expansion of privilege regards removal of early mods on the mod list. However, I believe this to be minimally destructive because there is no logic to e.g. delete unmodded holes. Tools that can be used imprudently, though without catastrophic consequences, are generally extended to all JL3. --- files/classes/user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/classes/user.py b/files/classes/user.py index 738255561..74a75fe28 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -187,7 +187,7 @@ class User(Base): @lazy def mod_date(self, sub): - if self.id == AEVANN_ID: return 1 + if self.admin_level >= 3: return 1 mod = g.db.query(Mod).filter_by(user_id=self.id, sub=sub).one_or_none() if not mod: return None return mod.created_utc From 001caf0c9867b79d00be68420e94362bd3e490a2 Mon Sep 17 00:00:00 2001 From: TLSM Date: Mon, 18 Jul 2022 04:39:21 -0400 Subject: [PATCH 10/12] LGB: Add static /kb/ route; two static pages. --- files/helpers/regex.py | 2 + files/routes/static.py | 14 +- .../kb/LGBDropTheT/resourcesorgs.html | 200 +++++++++++++++ files/templates/kb/LGBDropTheT/rulesfaqs.html | 227 ++++++++++++++++++ 4 files changed, 442 insertions(+), 1 deletion(-) create mode 100644 files/templates/kb/LGBDropTheT/resourcesorgs.html create mode 100644 files/templates/kb/LGBDropTheT/rulesfaqs.html diff --git a/files/helpers/regex.py b/files/helpers/regex.py index f63dc95ed..0553b96e6 100644 --- a/files/helpers/regex.py +++ b/files/helpers/regex.py @@ -104,6 +104,8 @@ git_regex = re.compile("ref: (refs/.+)", flags=re.A) pronouns_regex = re.compile("([a-z]{2,5}|i)/[a-z]{2,5}", flags=re.A) +knowledgebase_page_regex = re.compile("[a-zA-Z0-9_\-]+", flags=re.A) + def sub_matcher(match, upper=False): if match.group(0).startswith('<'): return match.group(0) diff --git a/files/routes/static.py b/files/routes/static.py index 3089848a0..00e3f0101 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -403,4 +403,16 @@ def transfers(v): comments = comments.offset(25 * (page - 1)).limit(26).all() next_exists = len(comments) > 25 comments = comments[:25] - return render_template("transfers.html", v=v, page=page, comments=comments, standalone=True, next_exists=next_exists) \ No newline at end of file + return render_template("transfers.html", v=v, page=page, comments=comments, standalone=True, next_exists=next_exists) + +@app.get("/kb/") +@auth_desired +def knowledgebase(v, page): + if not knowledgebase_page_regex.fullmatch(page): + abort(404) + + template_path = f'kb/{SITE_NAME}/{page}.html' + if not os.path.exists('files/templates/' + template_path): + abort(404) + + return render_template(template_path, v=v) diff --git a/files/templates/kb/LGBDropTheT/resourcesorgs.html b/files/templates/kb/LGBDropTheT/resourcesorgs.html new file mode 100644 index 000000000..9c6a0f980 --- /dev/null +++ b/files/templates/kb/LGBDropTheT/resourcesorgs.html @@ -0,0 +1,200 @@ +{% extends 'default.html' %} +{% block content %} +

    LGB RESOURCES AND ORGANIZATIONS

    +
    +

    If you would like to add additional resources, or find any information on this page is out-of-date, please visit our Resources & Organizations mega-thread. to alert site Admins.

    +
    +
    + +
    +
    + + +
    +

    INCLUSIVE

    +

    LGB Alliance - this link will be updated from SaidIt once we get a proper Wiki on this site

    +
      +
    • About: LGB Alliance began as a UK-based charity advocating for lesbians, gay men, and bisexuals. It now has chapters around the world.
    • +
    +

    LGB Fight Back

    +
      +
    • About: US organization of lesbians, gay men, and bisexuals who advocate for the interests of the LGB community.
    • +
    +
    +

    EXCLUSIVE

    +

    New Gay Liberation Front

    +
      +
    • About: US organization that advocates for the rights of lesbians and gay men.
    • +
    +

    Get The L Out - this link will be updated from SaidIt once we get a proper Wiki on this site

    +
      +
    • About: GetTheLOut is primarily a UK-based group representing lesbians. There are a few other chapters around the world.
    • +
    +
    +
    +
    + + +
    +

    LGB-SPECIFIC

    +

    After Ellen

    +
    +

    Lesbian and Gay News - closed / shut down

    +
    +
    +

    SUPPORTIVE / RELEVANT / ALLIES

    +

    Society for Evidence-based Gender Medicine

    +
    +

    The Glinner Update

    +
      +
    • About: Newsletter put out by Graham Linehan (the TV writer), an ally who is against transgender ideology.
    • +
    • Example Article: These are not lesbians
    • +
    +

    Transgender Trend

    +
    +
    +

    INDIVIDUAL ARTICLES / VIDEOS

    +
    +
    +
    +
    + + +
    +

    LGB-SPECIFIC

    +

    Arty Morty

    +
    +

    GNC Centric

    +
    +

    Magdalen Berns

    +
      +
    • About: Lesbian and feminist who is critical of identity politics, the destruction of women's rights due to transgender activism, and more. Sadly, Magdalen passed away in 2019 but her family has kept her channel active.
    • +
    • Example Video: The Cotton Ceiling: A Post Modern Affront to Lesbianism
    • +
    +

    Peachyoghurt Genderfree

    +
    +
    +

    SUPPORTIVE / RELEVANT / ALLIES

    +

    Benjamin Boyce

    +
      +
    • About: Does videos that are critical of "queer theory" (and of other strains of "critical theory", which is the intellectual parent of queer theory). Also interviews detransitioners, many of whom are LGB.
    • +
    • Example Video: GNC_Centric: Banned But Not Broken
    • +
    +

    You're Kiddin', Right?

    +
    +
    +

    INDIVIDUAL VIDEOS

    +
    +
    +
    +
    + + +
    +

    LGB-SPECIFIC

    +

    The Boxer Ceiling

    +
      +
    • About: Catalogues hate and harassment directed at gay men by the trans rights movement.
    • +
    +
    +

    SUPPORTIVE / RELEVANT / ALLIES

    +

    Placeholder Name

    +
      +
    • About: placeholder text
    • +
    +
    +
    +
    + + +{% endblock %} diff --git a/files/templates/kb/LGBDropTheT/rulesfaqs.html b/files/templates/kb/LGBDropTheT/rulesfaqs.html new file mode 100644 index 000000000..d1ee39468 --- /dev/null +++ b/files/templates/kb/LGBDropTheT/rulesfaqs.html @@ -0,0 +1,227 @@ +{% extends 'default.html' %} +{% block content %} + +

    RULES AND FAQS

    + +

    All rules are subject to Admin and Moderator discretion.

    + +

    We will not spell out every edge case for you. Common sense and accountability are required. That said, we do have a list of common FAQs below.

    + +

    You may be banned immediately for rule violations, or may be given warnings and temporarily muted from participation. You can appeal any action by messaging Admins. An appeal does not guarantee a ban/mute will be overturned. An appeal also does not mean you will get an explanation or response - trolls and instigators will be ignored.

    + +

    DO NOT send private chats or messages directly to Admins or Moderators about rules or site issues. Admins are also users like yourselves. Chat and messages are private and personal, and are not the appropriate venue to discuss actions taken on behalf of this site.

    + +

    If you have additional questions or concerns about these rules, please visit our Rules and FAQs mega-thread.

    +
    +
    + +
    +
    + + +
    +

    All LGB are welcome here, regardless of background or ideology.

    +

    Be respectful of each other's differences. Discuss and debate ideas, not individuals.

    +

    No slap-fights or name-calling.

    +
    +
      +
    • There are right-wing sources being posted here, I thought LGB were on the left?
    • +
      +

      LGB are not a monolith of political beliefs. We are non-partisan, and support users of all foundations - left, right, or otherwise. You may disagree personally with another user's beliefs, but they are allowed to have different core values.

      +

      Right-wing/conservative LGB people are welcome here. Left-wing/progressive people are welcome here. Anyone from any political party is welcome here, as long as they follow the rules and can have composed conversations about the issues at hand.

      +

      If we say right-wingers can't be part of this site and LGB, we're saying the same thing the TQ+ movement tells us: "we'll revoke your gay card because you're not playing by our specific rules". You can feel how you want to feel about the right and/or conservatives, but the LGB among them do have a seat at this table.

      +
      +
    • Why can't I stand up for myself if someone's calling me names, they started it!
    • +
      +

      We ask you to consider the LGB community as a whole, and how you want LGB represented.

      +

      You may critique a topic or behavior, but remember there is a real person on the other side of the screen. Take the high road, and remove yourself from the conversation if you cannot disagree respectfully.

      +

      If you have an issue with a user or a particular stance, take it up with them privately. Public fighting and taunting will be removed, and repeat offendors will be banned.

      +
    +
    +
    +
    + + +
    +

    Why LGB and TQ+ should no longer be part of the same organization.

    +

    LGB news, concerns, history, and/or personal affairs.

    +

    Other topics must demonstrate applicability towards LGB or "dropping the T".

    +
    +
      +
    • Why was my post about mens/womens issues removed?
    • +
      +

      The most likely reason is because it focused on how trans people are broadly impacting men/women, without mentioning LGB at all.

      +

      This is an LGB site first and foremost. We are separatists, and others may find this site seeking understanding of our stance, with no prior knowledge of the LGBTQ+ climate.

      +

      We support both men's and women's rights as they relate to LGB. We're not a platform for supporting men's or women's rights generally, such as "gender critical" or "the red pill".

      +

      Please be sure to demonstrate why/how LGB should take note of what's presented and "join hands across the aisle" of our respective groups, or the post will be removed.

      +
      +
    • Why was my post about politics removed?
    • +
      +

      The most likely reason is because it focused on how trans people are broadly impacting society, without mentioning LGB at all.

      +

      We're not here to discuss trans rights being changed legally - unless those changes have a direct impact on LGB.

      +

      While some politics are naturally involved in a civil rights movement, we are not a political organization. We are not pro- or anti-politics, so please remember to center LGB or "dropping the T" in your posts.

      +
    +
    +
    +
    + + +
    +

    No anti-trans memes/mockery. Posts about "trans people behaving badly" are not allowed unless it shows a clear and direct impact on LGB.

    +

    We're not here for AMAs or outside debate - no whataboutism or "why do you want to" or "Keep The T!" posts.

    +

    Straight/trans allies may post as long as content is LGB-relevant. No validation threads.

    +

    No agenda-pushing, dividing the community, or derailing.

    +
    +
      +
    • Trans and/or straight people are allowed here? I thought this was LGB only!
    • +
      +

      Allies are allowed to share here as long as they follow our rules. There are trans people who support the separation, as do straight people.

      +

      We will not allow this to become a forum about them and their needs though. We do not allow "I'm trans, ask me anything!" or "I'm straight, I have a few questions" types of posts.

      +

      We don't have any questions, we're not here to debate, and we're not here to validate you for supporting us. These kinds of posts will be removed, and repeat offenders will be banned.

      +
      +
    • What do you mean by "agenda-pushing" and "dividing the community"?
    • +
      +

      While certainly not an all-encompassing list, some examples are:

      +
      +

      - Posting about trans actions which impact groups other than LGB.

      +

      - Asserting your political or ideological belief as the only "real" truth.

      +

      - Asking questions that pit members of LGB against each other.

      +

      - Promoting TQ+ or GSRM, or other similar dogma.

      +

      - Adding a comment to a thread which has no bearing or relation to the post.

      +
      +

      Always keep the goal of LGB representation in mind, and consider our solidarity as a community.

      +
      +
    • No "whataboutism"? But I'm queer and have something to say that you need to hear! You're not allowing free speech!
    • +
      +

      We don't particularly care what you think about your freedom of speech in our space. Get out if you don't like it.

      +
    +
    +
    +
    + + +
    +

    No implying that men/women are defined by gender. Men are adult human males, and women are adult human females.

    +

    No implying that sexuality is defined by gender. Sexuality is an orientation, not an identity.

    +

    No homophobia/biphobia or accusations of bigotry.

    +

    No racism or anti-semitism.

    +

    No slurs, crudity, or shock/gore.

    +
    +
      +
    • Aren't you erasing trans people? They can be gay too!
    • +
      +

      Of course they can. But if a trans person feels they're lesbian/gay due to their gender identity, then we refute that.

      +

      A male who likes other males and transitions is still gay, he is merely a homosexual trans (HSTS) male presenting as female. A female who likes other females and transitions is still a lesbian, she is merely a homosexual trans female presenting as male.

      +

      We'll say it louder for the people in the back... SEXUAL ORIENTATION IS BASED ON BIOLOGICAL SEX, NOT GENDER IDENTITY. WE DO NOT BELIEVE HUMANS CAN CHANGE SEX.

      +
      +
    • What kind of slurs aren't allowed?
    • +
      +

      If you have to ask this, you may need to re-read rule 1.

      +

      We do not allow trancel, troon/troom, or any other slang devised to mock trans people. Language like that is better suited for Cringetopia.

      +

      Use of the word "tranny" will be reviewed on a case-by-case basis. Quoting someone else, referring to yourself, or discussing the usage is okay. Using the term towards someone else is not. Not everyone has accepted and made peace with it or reclaimed it, and we will respect that.

      +
      +
    • What do you mean by "crudity" or "shock/gore"?
    • +
      +

      Do you remember r/NeoVaginaDisasters? Pepperidge Farms remembers.

      +

      Nothing of that sort is allowed. That also includes written phrases like "pus-filled axe wound" or "sliced and flayed flesh hotdog".

      +

      Remember there is a real person on the other side, with actual feelings, who made a choice to transition and is now living with it. It's a slippery slope from "expression of truth" into disgust and/or hate speech, and it's not our place to shame people into regret.

      +
    +
    +
    +
    + + +
    +

    Don't post anything illegal.

    +

    No pornography or nudity.

    +

    No sexualizing minors.

    +

    No doxxing.

    +
    +
      +
    • What's illegal?
    • +
      +

      This can be considered as, but not limited to:

      +
      +

      - Piracy

      +

      - Advocating for or calls to violence

      +

      - Defamation/libel

      +

      - Production of counterfeit currency

      +

      - Copyright infringement

      +

      - Child, elder, or animal abuse

      +

      - Buying/selling anything (we are not a licensed marketplace or retailer)

      +
      +

      Whatever you're thinking of - if you walk out of your house doing it, will you get arrested? Don't do it here then. And for things you can do in secret inside, don't do that either.

      +
      +
    • What if pornography/nudity is demonstrative, like medical photos or someone's blog of their transition?
    • +
      +

      This will be reviewed on a case-by-case basis, and in conjunction with the rest of our rules.

      +

      If appropriate content, it must be in the form of a direct link, and publicly hosted on another site (no archives). Posts must be marked 18+ (NSFW).

      +

      We do not allow it to be on our site in the form of GIFs, images, backgrounds, PFPs, etc.

      +
      +
    • What counts as sexualizing minors?
    • +
      +

      +
      +
    • With doxxing, what if the person is a public figure and/or the information is already available online?
    • +
      +

      This will be reviewed on a case-by-case basis, and in conjunction with the rest of our rules.

      +

      If appropriate content, it must be in the form of a direct link, and publicly hosted on another site (no archives).

      +

      In general, we don't see much need for this sort of content. You might find Kiwi Farms more to your liking, if this is your thing.

      +
    +
    +
    +
    + + +{% endblock %} From 82de9657e9454e3a82eca4cc92097e1037efd602 Mon Sep 17 00:00:00 2001 From: TLSM Date: Mon, 18 Jul 2022 05:05:48 -0400 Subject: [PATCH 11/12] Fix commenting 500 from blackjack.py. Apparently the blackjack code didn't have the global constants. And was breaking everything when checking `FEATURES`. --- files/helpers/blackjack.py | 1 + 1 file changed, 1 insertion(+) diff --git a/files/helpers/blackjack.py b/files/helpers/blackjack.py index 49d75908a..48dda1dd9 100644 --- a/files/helpers/blackjack.py +++ b/files/helpers/blackjack.py @@ -1,6 +1,7 @@ from json.encoder import INFINITY import random from math import floor +from files.helpers.const import * deck_count = 4 ranks = ("2", "3", "4", "5", "6", "7", "8", "9", "X", "J", "Q", "K", "A") From 3225a2a3d48aa819b094f9a952611887cc53b5cc Mon Sep 17 00:00:00 2001 From: TLSM Date: Tue, 19 Jul 2022 19:59:39 -0400 Subject: [PATCH 12/12] LGB: disable awards, badges. --- .../assets/js/comments+submission_listing.js | 14 ++++++----- files/helpers/const.py | 6 +++-- files/routes/admin.py | 12 +++++++++ files/routes/awards.py | 14 +++++++++++ files/routes/static.py | 3 +++ files/templates/admin/admin_home.html | 22 +++++++++++----- files/templates/comments.html | 8 +++++- files/templates/header.html | 6 ++--- files/templates/mobile_navigation_bar.html | 2 ++ files/templates/post_actions.html | 2 +- files/templates/post_actions_mobile.html | 2 ++ files/templates/submission_listing.html | 4 ++- files/templates/userpage.html | 25 ++++++++++--------- files/templates/util/assetcache.html | 2 +- 14 files changed, 89 insertions(+), 33 deletions(-) diff --git a/files/assets/js/comments+submission_listing.js b/files/assets/js/comments+submission_listing.js index 49056b0f1..c081efc81 100644 --- a/files/assets/js/comments+submission_listing.js +++ b/files/assets/js/comments+submission_listing.js @@ -36,13 +36,15 @@ function popclick(e) { let popover = document.getElementsByClassName("popover") popover = popover[popover.length-1] - const badgesDOM = popover.getElementsByClassName('pop-badges')[0]; - badgesDOM.innerHTML = ""; - for (const badge of author["badges"]) { - const badgeDOM = popClickBadgeTemplateDOM.cloneNode(); - badgeDOM.src = badge + "?v=1021"; + if (popover.getElementsByClassName('pop-badges').length > 0) { + const badgesDOM = popover.getElementsByClassName('pop-badges')[0]; + badgesDOM.innerHTML = ""; + for (const badge of author["badges"]) { + const badgeDOM = popClickBadgeTemplateDOM.cloneNode(); + badgeDOM.src = badge + "?v=1021"; - badgesDOM.append(badgeDOM); + badgesDOM.append(badgeDOM); + } } popover.getElementsByClassName('pop-banner')[0].src = author["bannerurl"] diff --git a/files/helpers/const.py b/files/helpers/const.py index 260c0c78a..1ca362444 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -145,9 +145,11 @@ PERMS = { # Minimum admin_level to perform action. FEATURES = { 'PROCOINS': True, + 'AWARDS': True, 'CHAT': True, 'PINS': True, 'PRONOUNS': False, + 'BADGES': True, 'HOUSES': False, 'USERS_SUICIDE': True, 'GAMBLING': True, @@ -326,7 +328,9 @@ elif SITE == 'lgbdropthet.com': PERMS['USER_VOTERS_VISIBLE'] = 2 FEATURES['PROCOINS'] = False + FEATURES['AWARDS'] = False FEATURES['CHAT'] = False + FEATURES['BADGES'] = False FEATURES['USERS_SUICIDE'] = False FEATURES['GAMBLING'] = False @@ -352,8 +356,6 @@ else: # localhost or testing environment implied FEATURES['PRONOUNS'] = True FEATURES['HOUSES'] = True - FEATURES['GAMBLING'] = False - if SITE == 'deuxrama.net': PERMS['HOLE_CREATE'] = 3 PERMS['CONTENT_THREADS'] = 2 diff --git a/files/routes/admin.py b/files/routes/admin.py index c9e4040a8..66508b789 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -507,6 +507,9 @@ def under_attack(v): @app.get("/admin/badge_grant") @admin_level_required(2) def badge_grant_get(v): + if not FEATURES['BADGES']: + abort(404) + badges = g.db.query(BadgeDef).order_by(BadgeDef.id).all() return render_template("admin/badge_grant.html", v=v, badge_types=badges) @@ -515,6 +518,9 @@ def badge_grant_get(v): @limiter.limit("1/second;30/minute;200/hour;1000/day") @admin_level_required(2) def badge_grant_post(v): + if not FEATURES['BADGES']: + abort(404) + badges = g.db.query(BadgeDef).order_by(BadgeDef.id).all() user = get_user(request.values.get("username").strip(), graceful=True) @@ -562,6 +568,9 @@ def badge_grant_post(v): @app.get("/admin/badge_remove") @admin_level_required(2) def badge_remove_get(v): + if not FEATURES['BADGES']: + abort(404) + badges = g.db.query(BadgeDef).order_by(BadgeDef.id).all() return render_template("admin/badge_remove.html", v=v, badge_types=badges) @@ -571,6 +580,9 @@ def badge_remove_get(v): @limiter.limit("1/second;30/minute;200/hour;1000/day") @admin_level_required(2) def badge_remove_post(v): + if not FEATURES['BADGES']: + abort(404) + badges = g.db.query(BadgeDef).order_by(BadgeDef.id).all() user = get_user(request.values.get("username").strip(), graceful=True) diff --git a/files/routes/awards.py b/files/routes/awards.py index 3bd22e676..1dcf2e836 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -16,6 +16,9 @@ from copy import deepcopy @app.get("/settings/shop") @auth_required def shop(v): + if not FEATURES['AWARDS']: + abort(404) + AWARDS = deepcopy(AWARDS2) for val in AWARDS.values(): val["owned"] = 0 @@ -34,6 +37,9 @@ def shop(v): @app.post("/buy/") @auth_required def buy(v, award): + if not FEATURES['AWARDS']: + abort(404) + if award == 'benefactor' and not request.values.get("mb"): return {"error": "You can only buy the Benefactor award with marseybux."}, 403 @@ -106,6 +112,8 @@ def buy(v, award): @limiter.limit("1/second;30/minute;200/hour;1000/day", key_func=lambda:f'{SITE}-{session.get("lo_user")}') @is_not_permabanned def award_thing(v, thing_type, id): + if not FEATURES['AWARDS']: + abort(404) if thing_type == 'post': thing = get_post(id) else: thing = get_comment(id) @@ -315,6 +323,9 @@ def award_thing(v, thing_type, id): @app.get("/admin/awards") @admin_level_required(2) def admin_userawards_get(v): + if not FEATURES['AWARDS']: + abort(404) + if SITE == 'pcmemes.net' and v.admin_level < 3: abort(403) if v.admin_level != 3: @@ -326,6 +337,9 @@ def admin_userawards_get(v): @limiter.limit("1/second;30/minute;200/hour;1000/day") @admin_level_required(2) def admin_userawards_post(v): + if not FEATURES['AWARDS']: + abort(404) + if SITE == 'pcmemes.net' and v.admin_level < 3: abort(403) try: u = request.values.get("username").strip() diff --git a/files/routes/static.py b/files/routes/static.py index 00e3f0101..244f1ef5e 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -323,6 +323,9 @@ def badge_list(site): @app.get("/badges") @auth_required def badges(v): + if not FEATURES['BADGES']: + abort(404) + badges, counts = badge_list(SITE) return render_template("badges.html", v=v, badges=badges, counts=counts) diff --git a/files/templates/admin/admin_home.html b/files/templates/admin/admin_home.html index f303a7f38..2ed7ad5c4 100644 --- a/files/templates/admin/admin_home.html +++ b/files/templates/admin/admin_home.html @@ -23,9 +23,13 @@
  • Users Feed
  • Shadowbanned Users
  • Permabanned Users
  • -
  • Users with Chud Theme
  • -
  • Currently Grassed Users
  • -
  • Patrons / Paypigs
  • + {% if FEATURES['AWARDS'] -%} +
  • Users with Chud Theme
  • +
  • Currently Grassed Users
  • + {%- endif %} + {% if FEATURES['PROCOINS'] -%} +
  • Patrons / Paypigs
  • + {%- endif %}
  • Currently Logged-in Users
  • Currently Logged-out Users
@@ -36,12 +40,18 @@
  • Multi Vote Analysis
  • +{% if FEATURES['BADGES'] or FEATURES['AWARDS'] -%}

    Grant

    +{%- endif %}

    API Access Control

      diff --git a/files/templates/comments.html b/files/templates/comments.html index 176b233e7..1cc43559c 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -8,7 +8,7 @@ {% endif %} - {% if v %} + {% if v and FEATURES['AWARDS'] %} {% include "award_modal.html" %} {% endif %} @@ -25,8 +25,10 @@ + {% if FEATURES['BADGES'] -%}
      + {%- endif %}
      @@ -448,7 +450,9 @@ + {% if FEATURES['AWARDS'] -%} + {%- endif %} @@ -653,7 +657,9 @@ {% if v %} Report + {% if FEATURES['AWARDS'] -%} Give Award + {%- endif %} Save diff --git a/files/templates/header.html b/files/templates/header.html index ddd731d9f..1f5d2461b 100644 --- a/files/templates/header.html +++ b/files/templates/header.html @@ -130,11 +130,9 @@ {% if v and v.can_gamble and LOTTERY_ENABLED %} - - + - {% endif %} {%- endif %} + {% if FEATURES['AWARDS'] -%} + {%- endif %} {% else %} +{% if FEATURES['AWARDS'] -%} +{%- endif %} diff --git a/files/templates/submission_listing.html b/files/templates/submission_listing.html index 0c152e4ee..68322c721 100644 --- a/files/templates/submission_listing.html +++ b/files/templates/submission_listing.html @@ -1,7 +1,7 @@ {%- from 'util/assetcache.html' import asset, asset_siteimg with context -%} {%- import 'util/helpers.html' as help -%} -{% if v %} +{% if v and FEATURES['AWARDS'] %} {% include "award_modal.html" %} {% endif %} @@ -28,8 +28,10 @@
      + {% if FEATURES['BADGES'] -%}
      + {%- endif %}
      diff --git a/files/templates/userpage.html b/files/templates/userpage.html index 9bea79732..55ea71fe9 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -157,7 +157,7 @@
      {{u.enemies_html | safe}}
      {% endif %} - {% if u.received_awards %} + {% if u.received_awards and FEATURES['AWARDS'] %}

      Awards received

      {% for a in u.received_awards %} @@ -352,17 +352,18 @@
      -
      - {% for b in u.badges %} - {% if b.url %} - {{b.name}} - {% else %} - {{b.name}} - {% endif %} - {% endfor %} -
      - + {% if FEATURES['BADGES'] -%} +
      + {% for b in u.badges %} + {% if b.url %} + {{b.name}} + {% else %} + {{b.name}} + {% endif %} + {% endfor %} +
      + {%- endif %} @@ -471,7 +472,7 @@
      {{u.enemies_html | safe}}
      {% endif %} - {% if u.received_awards %} + {% if u.received_awards and FEATURES['AWARDS'] %}

      Awards received

      {% for a in u.received_awards %} diff --git a/files/templates/util/assetcache.html b/files/templates/util/assetcache.html index 45cf0172e..302320ad8 100644 --- a/files/templates/util/assetcache.html +++ b/files/templates/util/assetcache.html @@ -18,7 +18,7 @@ set CACHE_VER = { 'js/award_modal.js': 253, 'js/bootstrap.js': 275, - 'js/comments+submission_listing.js': 263, + 'js/comments+submission_listing.js': 264, 'js/submission_listing.js': 261, 'js/emoji_modal.js': 312, 'js/formatting.js': 240,