From 49bc6bbba9c6d8940becce512e275236b9b70142 Mon Sep 17 00:00:00 2001 From: Aevann Date: Sun, 20 Aug 2023 03:52:22 +0300 Subject: [PATCH] fix this https://rdrama.net/post/18459/marseycapywalking-megathread-for-bugs-and-suggestions/4831722#context --- files/helpers/alerts.py | 6 +++++- files/helpers/sanitize.py | 5 ----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/files/helpers/alerts.py b/files/helpers/alerts.py index d0cb8360c..dbb05fc11 100644 --- a/files/helpers/alerts.py +++ b/files/helpers/alerts.py @@ -156,7 +156,11 @@ def NOTIFY_USERS(text, v, oldtext=None, ghost=False, log_cost=None, followers_pi cost = 0 coin_receivers = set() - for i in group_mention_regex.finditer(text): + groups = group_mention_regex.finditer(text) + if len(list(groups)) > 5: + abort(403, "You can only ping a maximum of 5 ping groups!") + + for i in groups: if oldtext and i.group(1) in oldtext: continue diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 0277bcf1f..8ad3f7a1b 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -420,11 +420,6 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=False, count_emojis if not sanitized: return '' - if FEATURES['PING_GROUPS']: - ping_group_count = len(list(group_mention_regex.finditer(sanitized))) - if ping_group_count > 5: - error("You can only ping a maximum of 5 ping groups!") - if blackjack and execute_blackjack(g.v, None, sanitized, blackjack): sanitized = 'g'