From e55ef252abe03cd1caad871c912391e262180637 Mon Sep 17 00:00:00 2001 From: Ryan Barrett Date: Sun, 18 Feb 2024 13:49:37 -0800 Subject: [PATCH] minor tweak to heuristic for Feb 2024 Japanese mention spam flood --- activitypub.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activitypub.py b/activitypub.py index 67363bd..685d10f 100644 --- a/activitypub.py +++ b/activitypub.py @@ -894,7 +894,7 @@ def inbox(protocol=None, id=None): if type == 'Create': obj = activity.get('object', {}) mentions = [t for t in util.get_list(obj, 'tag') if t.get('type') == 'Mention'] - if (len(mentions) == 5 + if (len(mentions) in (4, 5) and len(util.get_list(obj, 'attachment')) == 1 and not obj.get('inReplyTo') and len(obj.get('attributedTo', '').split('/')[-1]) == 10):