From a896a6a956818f55b475dd738102ad1b7400c867 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 6 Apr 2019 15:23:32 -0600 Subject: [PATCH] Remove legacy AP --- app/Util/ActivityPub/Writer/BaseWriter.php | 136 --------------------- 1 file changed, 136 deletions(-) delete mode 100644 app/Util/ActivityPub/Writer/BaseWriter.php diff --git a/app/Util/ActivityPub/Writer/BaseWriter.php b/app/Util/ActivityPub/Writer/BaseWriter.php deleted file mode 100644 index 639c0e3f3..000000000 --- a/app/Util/ActivityPub/Writer/BaseWriter.php +++ /dev/null @@ -1,136 +0,0 @@ -context = $context; - return $this; - } - - public function setActor($profile) - { - $this->actor = $profile; - return $this; - } - - public function setActorActivity($activity) - { - $this->activity = $activity; - $this->setPublishedAt($activity->created_at->format('Y-m-d\Th:i:s\Z')); - return $this; - } - - public function setTo($audience) - { - $this->to = $audience; - return $this; - } - - public function setCc($audience) - { - $this->cc = $audience; - return $this; - } - - public function setBcc($audience) - { - $this->bcc = $audience; - return $this; - } - - public function setPublishedAt($timestamp) - { - $this->publishedAt = $timestamp; - return $this; - } - - public function audience($audience) - { - $this->setAudience($audience); - $this->buildAudience(); - return $this; - } - - public function setAudience($audience) - { - if(in_array($audience, $this->audience)) { - $this->audience = $audience; - } - return $this; - } - - public function buildAudience() - { - switch ($this->audience) { - case 'public': - $this->to = [ - $this->context . '#Public' - ]; - $this->cc = [ - $this->actor->permalink('/followers') - ]; - break; - - case 'unlisted': - $this->to = [ - $this->actor->permalink('/followers') - ]; - $this->cc = [ - $this->context . '#Public' - ]; - break; - - case 'private': - $this->to = [ - $this->actor->permalink('/followers') - ]; - break; - - default: - # code... - break; - } - return $this; - } - - public function get() - { - return $this->getJson(); - } - - public function getJson() - { - return json_encode($this->response); - } - - public function getArray() - { - return $this->response; - } -} \ No newline at end of file