Apply anti-grooming logic to chat.

master
Snakes 2022-10-16 16:18:49 -04:00
parent 2e48650b86
commit 912560327f
Signed by: Snakes
GPG Key ID: E745A82778055C7E
1 changed files with 3 additions and 0 deletions

View File

@ -86,6 +86,9 @@ def speak(data, v):
if not v.is_banned: v.ban_reason = 'Blackjack' if not v.is_banned: v.ban_reason = 'Blackjack'
g.db.add(v) g.db.add(v)
send_repeatable_notification(CARP_ID, f"{v.username} has been shadowbanned because of a chat message.") send_repeatable_notification(CARP_ID, f"{v.username} has been shadowbanned because of a chat message.")
elif ('discord.gg' in text or 'discord.com' in text or 'discordapp.com' in text):
# Follows same logic as in users.py:message2/messagereply; TODO: unify?
emit('speak', data)
elif recipient: elif recipient:
if user_ids_to_socket_ids.get(recipient): if user_ids_to_socket_ids.get(recipient):
recipient_sid = user_ids_to_socket_ids[recipient] recipient_sid = user_ids_to_socket_ids[recipient]