From 8ca2452dd05f614d55d2fd3ce188d9d04f44d285 Mon Sep 17 00:00:00 2001 From: winter Date: Fri, 20 Dec 2024 17:57:36 +0000 Subject: implement deletion/tombstones? --- Digitigrade/Job/ProcessIncomingPush.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'Digitigrade/Job/ProcessIncomingPush.php') 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); -- cgit v1.3