Ignore remote Creates to local_only communities

This commit is contained in:
freamon 2024-04-20 13:03:39 +01:00
parent cd0419a93a
commit 8275f75a28

View file

@ -514,6 +514,11 @@ def process_inbox_request(request_json, activitypublog_id, ip_address):
db.session.commit() db.session.commit()
return return
community = find_actor_or_create(community_ap_id, community_only=True) community = find_actor_or_create(community_ap_id, community_only=True)
if community and community.local_only:
activity_log.exception_message = 'Remote Create in local_only community'
activity_log.result = 'ignored'
db.session.commit()
return
user = find_actor_or_create(user_ap_id) user = find_actor_or_create(user_ap_id)
if (user and not user.is_local()) and community: if (user and not user.is_local()) and community:
user.last_seen = community.last_active = site.last_active = utcnow() user.last_seen = community.last_active = site.last_active = utcnow()