PeerTube: easier to just ignore anything from a accounts/peertube actor

This commit is contained in:
freamon 2024-05-26 17:22:52 +01:00
parent 7f2ed0b658
commit 3cd74ccc3b

View file

@ -412,17 +412,10 @@ def shared_inbox():
else: else:
process_delete_request.delay(request_json, activity_log.id, ip_address()) process_delete_request.delay(request_json, activity_log.id, ip_address())
return '' return ''
# Ignore PeerTube View activity # Ignore unutilised PeerTube activity
if 'type' in request_json and request_json['type'] == 'View': if 'actor' in request_json and request_json['actor'].endswith('accounts/peertube'):
activity_log.result = 'ignored' activity_log.result = 'ignored'
activity_log.exception_message = 'PeerTube View activity' activity_log.exception_message = 'PeerTube View or CacheFile activity'
db.session.add(activity_log)
db.session.commit()
return ''
# Ignore PeerTube CacheFile activity
if 'object' in request_json and 'type' in request_json['object'] and request_json['object']['type'] == 'CacheFile':
activity_log.result = 'ignored'
activity_log.exception_message = 'PeerTube CacheFile activity'
db.session.add(activity_log) db.session.add(activity_log)
db.session.commit() db.session.commit()
return '' return ''