activitypub: drop japanese spam flood mitigation

this stopped (at least to BF) as of 2/24
pull/910/head
Ryan Barrett 2024-03-01 10:56:49 -08:00
rodzic ca60c048fe
commit 4f239c92e5
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6BE31FDF4776E9D4
1 zmienionych plików z 0 dodań i 14 usunięć

Wyświetl plik

@ -899,20 +899,6 @@ def inbox(protocol=None, id=None):
logger.info('Dropping non-public activity')
return 'OK'
# temporary, for Feb 2024 Japanese mention spam flood
# examples:
# https://nafo.uk/@usc1qrtm8s/111953165825053473
# https://kish.social/@kj2hevtalc/111954393290908177
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) in (4, 5)
and len(util.get_list(obj, 'attachment')) in (0, 1)
and not obj.get('inReplyTo')
and len(obj.get('attributedTo', '').split('/')[-1]) == 10):
logger.warning('Ignoring, looks like Feb 2024 Japanese mention spam flood')
return 'Ignoring, looks like Feb 2024 Japanese mention spam flood'
if type == 'Follow':
# rendered mf2 HTML proxy pages (in render.py) fall back to redirecting
# to the follow's AS2 id field, but Mastodon's Accept ids are URLs that