do notify jannies

pull/225/head
Aevann 2024-03-06 00:32:39 +02:00
parent e84676cd50
commit 8ac49ae416
1 changed files with 29 additions and 24 deletions

View File

@ -303,7 +303,6 @@ def comment(v):
execute_longpostbot(c, level, body, body_html, post_target, v)
execute_zozbot(c, level, post_target, v)
if c.pinned != "Admin Note":
notify_users = NOTIFY_USERS(body, v, ghost=c.ghost, obj=c, commenters_ping_post_id=commenters_ping_post_id)
if notify_users == 'everyone':
@ -326,6 +325,9 @@ def comment(v):
if v.shadowbanned or c.is_banned:
notify_users = [x[0] for x in g.db.query(User.id).filter(User.id.in_(notify_users), User.admin_level >= PERMS['USER_SHADOWBAN']).all()]
if c.pinned == "Admin Note":
notify_users = [x[0] for x in g.db.query(User.id).filter(User.id.in_(notify_users), User.admin_level >= PERMS['ADMIN_NOTES']).all()]
for x in notify_users:
n = Notification(comment_id=c.id, user_id=x)
g.db.add(n)
@ -668,6 +670,9 @@ def edit_comment(cid, v):
else:
notify_users -= BOT_IDs
if c.pinned == "Admin Note":
notify_users = [x[0] for x in g.db.query(User.id).filter(User.id.in_(notify_users), User.admin_level >= PERMS['ADMIN_NOTES']).all()]
for x in notify_users:
notif = g.db.query(Notification).filter_by(comment_id=c.id, user_id=x).one_or_none()
if not notif: