diff --git a/files/routes/reporting.py b/files/routes/reporting.py index 47d170480..8820c2127 100644 --- a/files/routes/reporting.py +++ b/files/routes/reporting.py @@ -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() diff --git a/files/routes/subs.py b/files/routes/subs.py index 1045ce354..a1e00873a 100644 --- a/files/routes/subs.py +++ b/files/routes/subs.py @@ -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)