diff --git a/files/routes/comments.py b/files/routes/comments.py index 92e98e1f3..5e6113325 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -536,6 +536,7 @@ def api_comment(v): if 'aevann' in body_html.lower() and 1 not in notify_users: notify_users.add(1) if 'joan' in body_html.lower() and 28 not in notify_users: notify_users.add(28) if 'carp' in body_html.lower() and 995 not in notify_users: notify_users.add(995) + if ('idio3' in body_html.lower() or 'idio ' in body_html.lower()) and 30 not in notify_users: notify_users.add(30) for x in notify_users: n = Notification(comment_id=c.id, user_id=x) @@ -779,7 +780,7 @@ def edit_comment(cid, v): if 'aevann' in body_html.lower() and 1 not in notify_users: notify_users.add(1) if 'joan' in body_html.lower() and 28 not in notify_users: notify_users.add(28) if 'carp' in body_html.lower() and 995 not in notify_users: notify_users.add(995) - + if ('idio3' in body_html.lower() or 'idio ' in body_html.lower()) and 30 not in notify_users: notify_users.add(30) for x in notify_users: notif = notifs.filter_by(comment_id=c.id, user_id=x).first() diff --git a/files/routes/posts.py b/files/routes/posts.py index 478dd576d..851a56d38 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -71,6 +71,7 @@ def publish(pid, v): if 'aevann' in f'{post.body_html}{post.title}'.lower() and 1 not in notify_users: notify_users.add(1) if 'joan' in f'{post.body_html}{post.title}'.lower() and 28 not in notify_users: notify_users.add(28) if 'carp' in f'{post.body_html}{post.title}'.lower() and 995 not in notify_users: notify_users.add(995) + if ('idio3' in f'{post.body_html}{post.title}' or 'idio ' in f'{post.body_html}{post.title}') and 30 not in notify_users: notify_users.add(30) for x in notify_users: send_notification(x, f"@{v.username} has mentioned you: http://{site}{post.permalink}") @@ -342,6 +343,7 @@ def edit_post(pid, v): if 'aevann' in f'{body_html}{title}'.lower() and 1 not in notify_users: notify_users.add(1) if 'joan' in f'{body_html}{title}'.lower() and 28 not in notify_users: notify_users.add(28) if 'carp' in f'{body_html}{title}'.lower() and 995 not in notify_users: notify_users.add(995) + if ('idio3' in f'{body_html}{title}' or 'idio ' in f'{body_html}{title}') and 30 not in notify_users: notify_users.add(30) for x in notify_users: existing = g.db.query(Comment.id).filter(Comment.author_id == NOTIFICATIONS_ACCOUNT, Comment.body == message, Comment.notifiedto == x).first() @@ -790,6 +792,7 @@ def submit_post(v): if 'aevann' in f'{body_html}{title}'.lower() and 1 not in notify_users: notify_users.add(1) if 'joan' in f'{body_html}{title}'.lower() and 28 not in notify_users: notify_users.add(28) if 'carp' in f'{body_html}{title}'.lower() and 995 not in notify_users: notify_users.add(995) + if ('idio3' in f'{body_html}{title}' or 'idio ' in f'{body_html}{title}') and 30 not in notify_users: notify_users.add(30) for x in notify_users: send_notification(x, f"@{v.username} has mentioned you: http://{site}{new_post.permalink}")