forked from rDrama/rDrama
1
0
Fork 0

exclude me and homocracy from push notifs except for janny chat

master
Aevann 2024-06-03 15:13:01 +03:00
parent c38ed388ce
commit e4e2dc868c
2 changed files with 7 additions and 3 deletions

View File

@ -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
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:
return
@ -279,6 +279,10 @@ def push_notif(uids, title, body, url_or_comment):
if not uids:
return
if SITE == 'rdrama.net' and chat_id != 182:
uids.discard(AEVANN_ID)
uids.discard(147)
if isinstance(url_or_comment, Comment):
c = url_or_comment
if c.is_banned: return

View File

@ -162,7 +162,7 @@ def speak(data, v):
title = f'New messages in "{chat.name}"'
body = ''
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)
@ -183,7 +183,7 @@ def speak(data, v):
title = f'New mention of you in "{chat.name}"'
body = chat_message.text
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 = {