From f0c9a97fda848fcdcc5d8a009c7e74ad81a20130 Mon Sep 17 00:00:00 2001 From: TLSM Date: Wed, 29 Jun 2022 16:38:59 -0400 Subject: [PATCH 1/4] Suppress notifs for posts from shadowed. --- files/routes/subs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/routes/subs.py b/files/routes/subs.py index 2944d04453..5226011b18 100644 --- a/files/routes/subs.py +++ b/files/routes/subs.py @@ -353,7 +353,7 @@ def on_post_hole_entered(post, v): hole = post.subr.name # Notify hole followers - if not post.ghost and not post.private: + if not post.ghost and not post.private and not post.author.shadowbanned: text = f"/h/{hole} has a new " \ + f"post: [{post.title}]({post.shortlink}) by @{v.username}" cid = notif_comment(text, autojanny=True) From bf335812616ee56fbc016c60e652711633f93fa5 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Wed, 29 Jun 2022 21:00:01 +0000 Subject: [PATCH 2/4] sneed --- schema.sql | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/schema.sql b/schema.sql index c4ed4da1f5..eafc4f92df 100644 --- a/schema.sql +++ b/schema.sql @@ -2062,7 +2062,6 @@ SET row_security = off; COPY public.badge_defs (id, name, description) FROM stdin; 136 TRAIN 2022 Beware: Found to be one of the most transmisic commenters on the site! 137 Lottershe Winner This user won the Lottershe grand prize. -139 Kristallmopt This user was fired from a volunteer position 140 Y'all Seein' Eye Gets notified when other sites talk about us 141 Marsey Typographer For substantial and exceptional contributions to Marsey Alphabet. 142 Punching Down This user mogs incels. @@ -2070,6 +2069,8 @@ COPY public.badge_defs (id, name, description) FROM stdin; 144 Energy Drink Enjoyer Grip 'N Sip. 147 Freebase Fiend From the crack grew a glass rose. 148 Blackpilled Proud incel ally. +149 Thin This user has verified that they are calorically disciplined. +139 Auspicious Incident This user was fired from a volunteer position 4 White Hat Discreetly reported an exploit 1 Alpha User Joined during open alpha 2 Verified Email Verified Email @@ -2175,7 +2176,7 @@ COPY public.badge_defs (id, name, description) FROM stdin; -- Name: badge_defs_id_seq; Type: SEQUENCE SET; Schema: public; Owner: - -- -SELECT pg_catalog.setval('public.badge_defs_id_seq', 148, true); +SELECT pg_catalog.setval('public.badge_defs_id_seq', 149, true); -- From 0b95dc8cd19bed00d80afa2be3e728c5db983ef5 Mon Sep 17 00:00:00 2001 From: TLSM Date: Wed, 29 Jun 2022 18:11:38 -0400 Subject: [PATCH 3/4] WPD: Update sidebar flairs, restyle margin. --- files/templates/sidebar_Cringetopia.html | 18 +----------------- files/templates/sidebar_WPD.html | 19 ++----------------- files/templates/sidebar_rDrama.html | 18 +----------------- files/templates/util/assetcache.html | 2 +- 4 files changed, 5 insertions(+), 52 deletions(-) diff --git a/files/templates/sidebar_Cringetopia.html b/files/templates/sidebar_Cringetopia.html index f250491353..541856f5b9 100644 --- a/files/templates/sidebar_Cringetopia.html +++ b/files/templates/sidebar_Cringetopia.html @@ -1,4 +1,4 @@ - diff --git a/files/templates/sidebar_WPD.html b/files/templates/sidebar_WPD.html index ec2c22015d..45f8b321d7 100644 --- a/files/templates/sidebar_WPD.html +++ b/files/templates/sidebar_WPD.html @@ -1,4 +1,4 @@ - diff --git a/files/templates/sidebar_rDrama.html b/files/templates/sidebar_rDrama.html index 1d24418629..cb8ef50b74 100644 --- a/files/templates/sidebar_rDrama.html +++ b/files/templates/sidebar_rDrama.html @@ -21,7 +21,7 @@ set VISITORS_HERE_FLAVOR = [ ' throwing shade right now', ] -%} - diff --git a/files/templates/util/assetcache.html b/files/templates/util/assetcache.html index de627c6471..d20cc03346 100644 --- a/files/templates/util/assetcache.html +++ b/files/templates/util/assetcache.html @@ -1,6 +1,6 @@ {%- set CACHE_VER = { - 'css/main.css': 367, + 'css/main.css': 368, 'css/4chan.css': 61, 'css/classic.css': 61, From 467eb4408af3633f1329618c4a6c086d5778a80c Mon Sep 17 00:00:00 2001 From: TLSM Date: Thu, 30 Jun 2022 05:36:45 -0400 Subject: [PATCH 4/4] Fix hole_entered notif username. Previously, the on_post_hole_entered notifs to hole followers would contain the username of the admin who moved the post (due to referencing the `v` parameter of whomever performed the action which placed the post in the hole). This has been corrected to use the post author instead. Further, on_post_hole_entered only depends on a post for behavior, though the optional `v` user is used if present. --- files/routes/subs.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/files/routes/subs.py b/files/routes/subs.py index 5226011b18..008cfebd63 100644 --- a/files/routes/subs.py +++ b/files/routes/subs.py @@ -347,18 +347,20 @@ def rehole_post(v, pid, hole): return {"message": f"Post moved to {sub_to_str}!"} -def on_post_hole_entered(post, v): +def on_post_hole_entered(post, v=None): if not post.sub or not post.subr: return hole = post.subr.name + author = post.author # Notify hole followers - if not post.ghost and not post.private and not post.author.shadowbanned: + if not post.ghost and not post.private and not author.shadowbanned: text = f"/h/{hole} has a new " \ - + f"post: [{post.title}]({post.shortlink}) by @{v.username}" + + f"post: [{post.title}]({post.shortlink}) by @{author.username}" cid = notif_comment(text, autojanny=True) for follow in post.subr.followers: - if follow.user_id == v.id: continue + if follow.user_id == author.id or (v and follow.user_id == v.id): + continue user = get_account(follow.user_id) if post.club and not user.paid_dues: continue add_notif(cid, user.id)