From 4219abe95c0747d9075107df724e4fbbfd9f4a47 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 25 Jun 2019 00:10:34 -0600 Subject: [PATCH] Update AP Inbox --- app/Util/ActivityPub/Inbox.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/app/Util/ActivityPub/Inbox.php b/app/Util/ActivityPub/Inbox.php index 51b8c46c..2bfa1c78 100644 --- a/app/Util/ActivityPub/Inbox.php +++ b/app/Util/ActivityPub/Inbox.php @@ -235,7 +235,7 @@ class Inbox 'item_id' => $parent->id, 'item_type' => 'App\Status' ]); - + $parent->reblogs_count = $parent->shares()->count(); $parent->save(); } @@ -323,6 +323,20 @@ class Inbox break; case 'Announce': + abort_if(!Helpers::validateLocalUrl($obj), 400); + $status = Helpers::statusFetch($obj); + if(!$status) { + return; + } + Status::whereProfileId($profile->id) + ->whereReblogOfId($status->id) + ->forceDelete(); + Notification::whereProfileId($status->profile->id) + ->whereActorId($profile->id) + ->whereAction('share') + ->whereItemId($status->reblog_of_id) + ->whereItemType('App\Status') + ->forceDelete(); break; case 'Block': @@ -354,6 +368,6 @@ class Inbox ->forceDelete(); break; } - + return; } }