disable kms notifs for comments on WPD

remotes/1719271479679251571/master
Aevann 2024-02-23 23:52:18 +02:00
parent 9f205af1eb
commit 2a8ce229df
1 changed files with 2 additions and 2 deletions

View File

@ -8,7 +8,7 @@ import time
from sqlalchemy.sql import text
from sqlalchemy.orm import load_only
from files.classes import Comment, Notification, PushSubscription, Group, Mod
from files.classes import Comment, Post, Notification, PushSubscription, Group, Mod
from .config.const import *
from .regex import *
@ -163,7 +163,7 @@ def NOTIFY_USERS(text, v, oldtext=None, ghost=False, obj=None, followers_ping=Tr
user_ids = get_users(names, ids_only=True, graceful=True)
notify_users.update(user_ids)
if SITE_NAME == "WPD" and ('daisy' in text or 'kill myself' in text):
if SITE_NAME == "WPD" and ('daisy' in text or ('kill myself' in text and obj and isinstance(obj, Post))):
admin_ids = [x[0] for x in g.db.query(User.id).filter(User.admin_level >= PERMS['NOTIFICATIONS_SPECIFIC_WPD_COMMENTS'], User.id != AEVANN_ID)]
notify_users.update(admin_ids)