diff options
| author | winter | 2024-12-20 17:57:36 +0000 |
|---|---|---|
| committer | winter | 2024-12-20 18:01:26 +0000 |
| commit | 8ca2452dd05f614d55d2fd3ce188d9d04f44d285 (patch) | |
| tree | 7c850737c216df179ce00fa874b1de508894eb71 /Digitigrade/Model/Actor.php | |
| parent | 583b1f8a865935dd4ae1b0c9fa40a4b347ea3d4d (diff) | |
implement deletion/tombstones?
Diffstat (limited to 'Digitigrade/Model/Actor.php')
| -rw-r--r-- | Digitigrade/Model/Actor.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Digitigrade/Model/Actor.php b/Digitigrade/Model/Actor.php index 07f24ec..8059409 100644 --- a/Digitigrade/Model/Actor.php +++ b/Digitigrade/Model/Actor.php @@ -196,7 +196,22 @@ class Actor extends PushableModel implements RpcReceiver { return Instance::findByHostname(hostname_from_uri($this->uri)); } + protected function getRelevantServers(): array { + $actors = array_unique(array_merge($this->findFollowers(), $this->findFollowees())); + $instances = array_unique(array_map(function (Actor $actor) { + return Instance::findByHostname(hostname_from_uri($actor->uri)); + }, $actors)); + return $instances; + } + public function jsonSerialize(): array { + if ($this->deleted) { + return [ + 'type' => 'tombstone', + 'self' => path_to_uri("/user/$this->handle"), + 'previousType' => 'actor' + ]; + } return [ 'type' => 'actor', 'self' => path_to_uri("/user/$this->handle"), |
