From 53c495d25f1ec52e8c54caaa69dd69d0a48ce339 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 13 Aug 2022 09:08:32 +0200 Subject: [PATCH] do this https://rdrama.org/post/18459/marseycapywalking-megathread-for-bugs-and-suggestions/2412894?context=8#context --- files/routes/subs.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/files/routes/subs.py b/files/routes/subs.py index f6c29406b..80cc29326 100644 --- a/files/routes/subs.py +++ b/files/routes/subs.py @@ -455,6 +455,10 @@ def hole_pin(v, pid): p.hole_pinned = v.username g.db.add(p) + if v.id != p.author_id: + message = f"@{v.username} (Mod) has pinned your [post]({p.shortlink}) in /h/{p.sub}" + send_repeatable_notification(p.author_id, message) + return {"message": f"Post pinned to /h/{p.sub}"} @app.post("/hole_unpin/") @@ -469,4 +473,8 @@ def hole_unpin(v, pid): p.hole_pinned = None g.db.add(p) - return {"message": f"Post unpinned from /h/{p.sub}"} + if v.id != p.author_id: + message = f"@{v.username} (Mod) has unpinned your [post]({p.shortlink}) in /h/{p.sub}" + send_repeatable_notification(p.author_id, message) + + return {"message": f"Post unpinned from /h/{p.sub}"} \ No newline at end of file