forked from rDrama/rDrama
generate notifs for moving posts
parent
7201d55f69
commit
87f3af5968
|
@ -74,6 +74,12 @@ def flag_post(pid, v):
|
|||
)
|
||||
g.db.add(ma)
|
||||
|
||||
if v.id != post.author_id:
|
||||
if v.admin_level >= 3: position = 'Admin'
|
||||
else: position = 'Mod'
|
||||
message = f"@{v.username} ({position}) has moved [{post.title}]({post.shortlink}) to /h/{post.sub}"
|
||||
send_repeatable_notification(post.author_id, message)
|
||||
|
||||
return {"message": f"Post moved to /h/{post.sub}"}
|
||||
else:
|
||||
existing = g.db.query(Flag.post_id).filter_by(user_id=v.id, post_id=post.id).one_or_none()
|
||||
|
|
|
@ -366,6 +366,13 @@ def kick(v, pid):
|
|||
_note=f'{old_str} → main feed',
|
||||
)
|
||||
g.db.add(ma)
|
||||
|
||||
if v.id != post.author_id:
|
||||
if v.admin_level >= 3: position = 'Admin'
|
||||
else: position = 'Mod'
|
||||
message = f"@{v.username} ({position}) has moved [{post.title}]({post.shortlink}) from /h/{old} to the main feed!"
|
||||
send_repeatable_notification(post.author_id, message)
|
||||
|
||||
g.db.add(post)
|
||||
|
||||
cache.delete_memoized(frontlist)
|
||||
|
|
Loading…
Reference in New Issue