same as last commit

pull/227/head
Aevann 2024-05-26 04:26:15 +03:00
parent b5249645bf
commit 9da02617cf
1 changed files with 13 additions and 14 deletions

View File

@ -166,25 +166,24 @@ def speak(data, v):
if chat.id != 1:
notify_users = NOTIFY_USERS(chat_message.text, v)
if chat_message.quotes:
notify_users.add(chat_message.quoted_message.user_id)
notify_users -= alrdy_here
memberships = g.db.query(ChatMembership).options(load_only(ChatMembership.user_id)).filter(
ChatMembership.chat_id == chat_id,
ChatMembership.user_id.in_(notify_users),
)
for membership in memberships:
membership.mentions += 1
g.db.add(membership)
if notify_users:
memberships = g.db.query(ChatMembership).options(load_only(ChatMembership.user_id)).filter(
ChatMembership.chat_id == chat_id,
ChatMembership.user_id.in_(notify_users),
)
for membership in memberships:
membership.mentions += 1
g.db.add(membership)
uids = set(x.user_id for x in memberships)
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)
uids = set(x.user_id for x in memberships)
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)
data = {