This commit is contained in:
Aevann1 2021-12-02 22:48:13 +02:00
parent 9ec62479c3
commit b8bf2c0ff9
5 changed files with 39 additions and 73 deletions

View file

@ -127,3 +127,11 @@ def send_admin(vid, text):
for admin in admins:
notif = Notification(comment_id=new_comment.id, user_id=admin.id)
g.db.add(notif)
def NOTIFY_USERS(text, vid):
text = text.lower()
notify_users = set()
for word, id in NOTIFIED_USERS:
if id == 0: continue
if word in text and id not in notify_users and vid != id: notify_users.add(id)
return notify_users