Aevann1 2022-08-13 09:08:32 +02:00
parent b9453bac03
commit 53c495d25f
1 changed files with 9 additions and 1 deletions

View File

@ -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/<pid>")
@ -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}"}