Reject statuses from deactivated remote users

This commit is contained in:
Mouse Reeve
2021-04-17 17:55:22 -07:00
parent b53c2c2196
commit 02e6602a0b
5 changed files with 43 additions and 5 deletions

View File

@ -80,6 +80,12 @@ def is_blocked_user_agent(request):
def is_blocked_activity(activity_json):
""" get the sender out of activity json and check if it's blocked """
actor = activity_json.get("actor")
# check if the user is banned/deleted
existing = models.User.find_existing_by_remote_id(actor)
if existing and existing.deleted:
return True
if not actor:
# well I guess it's not even a valid activity so who knows
return False