forked from rDrama/rDrama
replace "bots" with "BOT_IDs"
parent
16e326bb9c
commit
6eff7abe49
|
@ -28,7 +28,7 @@ def create_comment(text_html):
|
||||||
|
|
||||||
def send_repeatable_notification(uid, text):
|
def send_repeatable_notification(uid, text):
|
||||||
|
|
||||||
if uid in bots: return
|
if uid in BOT_IDs: return
|
||||||
|
|
||||||
text_html = sanitize(text, blackjack="notification")
|
text_html = sanitize(text, blackjack="notification")
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ def send_repeatable_notification(uid, text):
|
||||||
|
|
||||||
def send_notification(uid, text):
|
def send_notification(uid, text):
|
||||||
|
|
||||||
if uid in bots: return
|
if uid in BOT_IDs: return
|
||||||
cid = notif_comment(text)
|
cid = notif_comment(text)
|
||||||
add_notif(cid, uid, text)
|
add_notif(cid, uid, text)
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ def notif_comment2(p):
|
||||||
|
|
||||||
|
|
||||||
def add_notif(cid, uid, text, pushnotif_url=''):
|
def add_notif(cid, uid, text, pushnotif_url=''):
|
||||||
if uid in bots: return
|
if uid in BOT_IDs: return
|
||||||
|
|
||||||
existing = g.db.query(Notification.user_id).filter_by(comment_id=cid, user_id=uid).one_or_none()
|
existing = g.db.query(Notification.user_id).filter_by(comment_id=cid, user_id=uid).one_or_none()
|
||||||
if not existing:
|
if not existing:
|
||||||
|
@ -182,7 +182,7 @@ def NOTIFY_USERS(text, v, oldtext=None, ghost=False):
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return notify_users - bots - {v.id, 0} - v.all_twoway_blocks
|
return notify_users - BOT_IDs - {v.id, 0} - v.all_twoway_blocks
|
||||||
|
|
||||||
|
|
||||||
def push_notif(uids, title, body, url_or_comment):
|
def push_notif(uids, title, body, url_or_comment):
|
||||||
|
|
|
@ -924,7 +924,7 @@ else: # localhost or testing environment implied
|
||||||
|
|
||||||
HOUSES = ("None","Furry","Femboy","Vampire","Racist") if FEATURES['HOUSES'] else ("None")
|
HOUSES = ("None","Furry","Femboy","Vampire","Racist") if FEATURES['HOUSES'] else ("None")
|
||||||
|
|
||||||
bots = {AUTOJANNY_ID, SNAPPY_ID, LONGPOSTBOT_ID, ZOZBOT_ID}
|
BOT_IDs = {AUTOJANNY_ID, SNAPPY_ID, LONGPOSTBOT_ID, ZOZBOT_ID}
|
||||||
|
|
||||||
COLORS = {'ff66ac','805ad5','62ca56','38a169','80ffff','2a96f3','eb4963','ff0000','f39731','30409f','3e98a7','e4432d','7b9ae4','ec72de','7f8fa6', 'f8db58','8cdbe6', DEFAULT_COLOR}
|
COLORS = {'ff66ac','805ad5','62ca56','38a169','80ffff','2a96f3','eb4963','ff0000','f39731','30409f','3e98a7','e4432d','7b9ae4','ec72de','7f8fa6', 'f8db58','8cdbe6', DEFAULT_COLOR}
|
||||||
|
|
||||||
|
|
|
@ -151,7 +151,7 @@ def create_comment_duplicated(text_html):
|
||||||
|
|
||||||
def send_repeatable_notification_duplicated(uid, text):
|
def send_repeatable_notification_duplicated(uid, text):
|
||||||
|
|
||||||
if uid in bots: return
|
if uid in BOT_IDs: return
|
||||||
|
|
||||||
text_html = sanitize(text)
|
text_html = sanitize(text)
|
||||||
|
|
||||||
|
|
|
@ -342,7 +342,7 @@ def comment(v:User):
|
||||||
if parent_user.id != v.id and notify_op:
|
if parent_user.id != v.id and notify_op:
|
||||||
notify_users.add(parent_user.id)
|
notify_users.add(parent_user.id)
|
||||||
|
|
||||||
for x in notify_users-bots:
|
for x in notify_users-BOT_IDs:
|
||||||
n = Notification(comment_id=c.id, user_id=x)
|
n = Notification(comment_id=c.id, user_id=x)
|
||||||
g.db.add(n)
|
g.db.add(n)
|
||||||
|
|
||||||
|
@ -641,7 +641,7 @@ def edit_comment(cid, v):
|
||||||
if notify_users == 'everyone':
|
if notify_users == 'everyone':
|
||||||
alert_everyone(c.id)
|
alert_everyone(c.id)
|
||||||
else:
|
else:
|
||||||
for x in notify_users-bots:
|
for x in notify_users-BOT_IDs:
|
||||||
notif = g.db.query(Notification).filter_by(comment_id=c.id, user_id=x).one_or_none()
|
notif = g.db.query(Notification).filter_by(comment_id=c.id, user_id=x).one_or_none()
|
||||||
if not notif:
|
if not notif:
|
||||||
n = Notification(comment_id=c.id, user_id=x)
|
n = Notification(comment_id=c.id, user_id=x)
|
||||||
|
|
|
@ -570,7 +570,7 @@ def message2(v:User, username:str):
|
||||||
execute_under_siege(v, c, c.body_html, 'message')
|
execute_under_siege(v, c, c.body_html, 'message')
|
||||||
c.top_comment_id = c.id
|
c.top_comment_id = c.id
|
||||||
|
|
||||||
if user.id not in bots:
|
if user.id not in BOT_IDs:
|
||||||
notif = g.db.query(Notification).filter_by(comment_id=c.id, user_id=user.id).one_or_none()
|
notif = g.db.query(Notification).filter_by(comment_id=c.id, user_id=user.id).one_or_none()
|
||||||
if not notif:
|
if not notif:
|
||||||
notif = Notification(comment_id=c.id, user_id=user.id)
|
notif = Notification(comment_id=c.id, user_id=user.id)
|
||||||
|
@ -648,7 +648,7 @@ def messagereply(v:User):
|
||||||
execute_blackjack(v, c, c.body_html, 'message')
|
execute_blackjack(v, c, c.body_html, 'message')
|
||||||
execute_under_siege(v, c, c.body_html, 'message')
|
execute_under_siege(v, c, c.body_html, 'message')
|
||||||
|
|
||||||
if user_id and user_id not in {v.id, MODMAIL_ID} | bots:
|
if user_id and user_id not in {v.id, MODMAIL_ID} | BOT_IDs:
|
||||||
notif = g.db.query(Notification).filter_by(comment_id=c.id, user_id=user_id).one_or_none()
|
notif = g.db.query(Notification).filter_by(comment_id=c.id, user_id=user_id).one_or_none()
|
||||||
if not notif:
|
if not notif:
|
||||||
notif = Notification(comment_id=c.id, user_id=user_id)
|
notif = Notification(comment_id=c.id, user_id=user_id)
|
||||||
|
|
Loading…
Reference in New Issue