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/Job | |
| parent | 583b1f8a865935dd4ae1b0c9fa40a4b347ea3d4d (diff) | |
implement deletion/tombstones?
Diffstat (limited to 'Digitigrade/Job')
| -rw-r--r-- | Digitigrade/Job/ProcessIncomingPush.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Digitigrade/Job/ProcessIncomingPush.php b/Digitigrade/Job/ProcessIncomingPush.php index fefa122..4f6d955 100644 --- a/Digitigrade/Job/ProcessIncomingPush.php +++ b/Digitigrade/Job/ProcessIncomingPush.php @@ -18,6 +18,14 @@ class ProcessIncomingPush extends Job { public function run() { assert(isset($this->object->type)); $log = Logger::getInstance(); + $type = $this->object->type; + if ($type == 'tombstone') { + if (!isset($this->object->previousType)) { + throw new \RuntimeException('tombstone object does not have a previousType'); + } + $log->info('the following object import is actually a tombstone ...'); + $type = $this->object->previousType; + } switch ($this->object->type) { case 'actor': $log->info('importing actor with uri ' . $this->object->self); @@ -32,7 +40,6 @@ class ProcessIncomingPush extends Job { Interaction::importFromReceivedObject($this->object); break; case 'extension': - case 'tombstone': throw new \RuntimeException('object type ' . $this->object->type . ' not yet implemented :('); default: throw new \RuntimeException('invalid object type: ' . $this->object->type); |
