From c3ae4810482b672078a1e0f2f64b7b6cf39f497e Mon Sep 17 00:00:00 2001 From: Absinthe <105433270+Absinthe2@users.noreply.github.com> Date: Thu, 12 May 2022 16:21:11 +0200 Subject: [PATCH 4/6] #factcheck (#261) Like #fortune but to check facts. --- files/helpers/sanitize.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index cd34cd528..c705f7e20 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -249,6 +249,10 @@ def sanitize(sanitized, alert=False, comment=False, edit=False): sanitized = sanitized.replace('#fortune', '') sanitized += '\n\n

' + choice(FORTUNE_REPLIES) + '

' + if '#factcheck' in sanitized: + sanitized = sanitized.replace('#factcheck', '') + sanitized += '\n\n

' + choice(FACTCHECK_REPLIES) + '

' + sanitized = sanitized.replace('&','&') sanitized = utm_regex.sub('', sanitized) sanitized = utm_regex2.sub('', sanitized) @@ -328,4 +332,4 @@ def filter_emojis_only(title, edit=False, graceful=False): signal.alarm(0) if len(title) > 1500 and not graceful: abort(400) - else: return title \ No newline at end of file + else: return title From a829b156d7d7598d10647b892d70046fa0fc8312 Mon Sep 17 00:00:00 2001 From: Absinthe <105433270+Absinthe2@users.noreply.github.com> Date: Thu, 12 May 2022 16:21:20 +0200 Subject: [PATCH 5/6] #Factcheck Replies (#262) Replies for #factcheck. --- files/helpers/const.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/files/helpers/const.py b/files/helpers/const.py index bf277b388..03e863a17 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -697,6 +697,8 @@ NOTIFIED_USERS = { FORTUNE_REPLIES = ('Your fortune: Allah Wills It','Your fortune: Inshallah, Only Good Things Shall Come To Pass','Your fortune: Allah Smiles At You This Day','Your fortune: Your Bussy Is In For A Blasting','Your fortune: You Will Be Propositioned By A High-Tier Twink','Your fortune: Repent, You Have Displeased Allah And His Vengeance Is Nigh','Your fortune: Reply Hazy, Try Again','Your fortune: lmao you just lost 100 coins','Your fortune: Yikes 😬','Your fortune: You Will Be Blessed With Many Black Bulls','Your fortune: NEETmax, The Day Is Lost If You Venture Outside','Your fortune: A Taste Of Jannah Awaits You Today','Your fortune: Watch Your Back','Your fortune: Outlook good','Your fortune: Godly Luck','Your fortune: Good Luck','Your fortune: Bad Luck','Your fortune: Good news will come to you by mail','Your fortune: Very Bad Luck','Your fortune: キタ━━━━━━(οΎŸβˆ€οΎŸ)━━━━━━ !!!!','Your fortune: Better not tell you now','Your fortune: You will meet a dark handsome stranger','Your fortune: οΌˆγ€€Β΄_ゝ`οΌ‰οΎŒο½°οΎ','Your fortune: Excellent Luck','Your fortune: Average Luck') +FACTCHECK_REPLIES = ('Factcheck: This claim has been confirmed as correct by experts. ','Factcheck: This claim has been classified as misogynistic.','Factcheck: This claim is currently being debunked.','Factcheck: This claim is 100% true.','Factcheck: This claim hurts trans lives.','Factcheck: [REDACTED].','Factcheck: This claim is both true and false.','Factcheck: You really believe that shit? Lmao dumbass nigga 🀣','Factcheck: None of this is real.','Factcheck: Yes.','Factcheck: This claim has not been approved by experts.','Factcheck: This claim is a gross exageration of reality.','Factcheck: WARNING! THIS CLAIM HAS BEEN CLASSIFIED AS DANGEROUS. PLEASE REMAIN STILL, AN AGENT WILL COME TO MEET YOU SHORTLY.') + if SITE_NAME == 'rDrama': patron = 'Paypig' else: patron = 'Patron' From 9be2264a6569f05ebd68904e21c29779ed1c2098 Mon Sep 17 00:00:00 2001 From: float-trip <102226344+float-trip@users.noreply.github.com> Date: Thu, 12 May 2022 10:21:55 -0400 Subject: [PATCH 6/6] Fix profile CSS on localhost (#260) --- files/routes/users.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/files/routes/users.py b/files/routes/users.py index 0d7fee553..86332e0f3 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -541,8 +541,9 @@ def leaderboard(v): @app.get("/@/css") def get_css(username): user = get_user(username) - resp=make_response(user.css or "") - resp.headers.add("Content-Type", "text/css") + resp = make_response(user.css or "") + resp.headers["Content-Type"] = "text/css" + resp.headers["Referrer-Policy"] = "no-referrer" return resp @app.get("/@/profilecss") @@ -550,8 +551,9 @@ def get_profilecss(username): user = get_user(username) if user.profilecss: profilecss = user.profilecss else: profilecss = "" - resp=make_response(profilecss) - resp.headers.add("Content-Type", "text/css") + resp = make_response(profilecss) + resp.headers["Content-Type"] = "text/css" + resp.headers["Referrer-Policy"] = "no-referrer" return resp @app.get("/id//profilecss") @@ -559,8 +561,9 @@ def get_profilecss_id(id): user = get_account(id) if user.profilecss: profilecss = user.profilecss else: profilecss = "" - resp=make_response(profilecss) - resp.headers.add("Content-Type", "text/css") + resp = make_response(profilecss) + resp.headers["Content-Type"] = "text/css" + resp.headers["Referrer-Policy"] = "no-referrer" return resp @app.get("/@/song")