forked from rDrama/rDrama
exclude me and homocracy from push notifs except for janny chat
parent
c38ed388ce
commit
e4e2dc868c
|
@ -270,7 +270,7 @@ def NOTIFY_USERS(text, v, oldtext=None, ghost=False, obj=None, followers_ping=Tr
|
||||||
return notify_users - BOT_IDs - {v.id, 0} - v.all_twoway_blocks - v.muters
|
return notify_users - BOT_IDs - {v.id, 0} - v.all_twoway_blocks - v.muters
|
||||||
|
|
||||||
|
|
||||||
def push_notif(uids, title, body, url_or_comment):
|
def push_notif(uids, title, body, url_or_comment, chat_id=None):
|
||||||
if VAPID_PUBLIC_KEY == DEFAULT_CONFIG_VALUE:
|
if VAPID_PUBLIC_KEY == DEFAULT_CONFIG_VALUE:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -279,6 +279,10 @@ def push_notif(uids, title, body, url_or_comment):
|
||||||
if not uids:
|
if not uids:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if SITE == 'rdrama.net' and chat_id != 182:
|
||||||
|
uids.discard(AEVANN_ID)
|
||||||
|
uids.discard(147)
|
||||||
|
|
||||||
if isinstance(url_or_comment, Comment):
|
if isinstance(url_or_comment, Comment):
|
||||||
c = url_or_comment
|
c = url_or_comment
|
||||||
if c.is_banned: return
|
if c.is_banned: return
|
||||||
|
|
|
@ -162,7 +162,7 @@ def speak(data, v):
|
||||||
title = f'New messages in "{chat.name}"'
|
title = f'New messages in "{chat.name}"'
|
||||||
body = ''
|
body = ''
|
||||||
url = f'{SITE_FULL}/chat/{chat.id}'
|
url = f'{SITE_FULL}/chat/{chat.id}'
|
||||||
push_notif(uids, title, body, url)
|
push_notif(uids, title, body, url, chat_id=chat.id)
|
||||||
|
|
||||||
|
|
||||||
notify_users = NOTIFY_USERS(chat_message.text, v)
|
notify_users = NOTIFY_USERS(chat_message.text, v)
|
||||||
|
@ -183,7 +183,7 @@ def speak(data, v):
|
||||||
title = f'New mention of you in "{chat.name}"'
|
title = f'New mention of you in "{chat.name}"'
|
||||||
body = chat_message.text
|
body = chat_message.text
|
||||||
url = f'{SITE_FULL}/chat/{chat.id}#{chat_message.id}'
|
url = f'{SITE_FULL}/chat/{chat.id}#{chat_message.id}'
|
||||||
push_notif(uids, title, body, url)
|
push_notif(uids, title, body, url, chat_id=chat.id)
|
||||||
|
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
|
|
Loading…
Reference in New Issue