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