From 8f2457bbc8f9a0cbf9336a5a0f1e47cccb884c0f Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Wed, 29 Apr 2020 20:28:30 -0600 Subject: [PATCH] Update Inbox, only log new activities --- app/Util/ActivityPub/Inbox.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/Util/ActivityPub/Inbox.php b/app/Util/ActivityPub/Inbox.php index 4b8f93923..596365106 100644 --- a/app/Util/ActivityPub/Inbox.php +++ b/app/Util/ActivityPub/Inbox.php @@ -41,9 +41,15 @@ class Inbox { $this->handleVerb(); - (new Activity())->create([ - 'data' => json_encode($this->payload) - ]); + if(!Activity::where('data->id', $this->payload['id'])->exists()){ + (new Activity())->create([ + 'to_id' => $this->profile->id, + 'data' => json_encode($this->payload) + ]); + } + + return; + } public function handleVerb()