diff --git a/users/models/identity.py b/users/models/identity.py index f65ad0b..df7d9c9 100644 --- a/users/models/identity.py +++ b/users/models/identity.py @@ -55,7 +55,7 @@ class IdentityStates(StateGraph): edited = State(try_interval=300, attempt_immediately=True) deleted = State(try_interval=300, attempt_immediately=True) - deleted_fanned_out = State(delete_after=86400 * 7) + deleted_fanned_out = State(externally_progressed=True) moved = State(try_interval=300, attempt_immediately=True) moved_fanned_out = State(externally_progressed=True) @@ -582,7 +582,7 @@ class Identity(StatorModel): self.ensure_uris() response = { "id": self.actor_uri, - "type": self.actor_type.title(), + "type": "Tombstone" if self.deleted else self.actor_type.title(), "inbox": self.inbox_uri, "outbox": self.outbox_uri, "featured": self.featured_collection_uri, diff --git a/users/views/identity.py b/users/views/identity.py index 028e49a..11bb470 100644 --- a/users/views/identity.py +++ b/users/views/identity.py @@ -64,10 +64,13 @@ class ViewIdentity(ListView): # If this not a local actor, redirect to their canonical URI if not identity.local: return redirect(identity.actor_uri) - return JsonResponse( + r = JsonResponse( canonicalise(identity.to_ap(), include_security=True), content_type="application/activity+json", ) + if identity.deleted: + r.status_code = 410 + return r def get_queryset(self): return TimelineService(None).identity_public(