diff --git a/app/Jobs/SharePipeline/SharePipeline.php b/app/Jobs/SharePipeline/SharePipeline.php index 2cc807ac..528c78ca 100644 --- a/app/Jobs/SharePipeline/SharePipeline.php +++ b/app/Jobs/SharePipeline/SharePipeline.php @@ -63,7 +63,7 @@ class SharePipeline implements ShouldQueue return true; } - ReblogService::addPostReblog($parent->id, $status->id); + ReblogService::addPostReblog($parent->profile_id, $status->id); $parent->reblogs_count = $parent->reblogs_count + 1; $parent->save(); diff --git a/app/Jobs/SharePipeline/UndoSharePipeline.php b/app/Jobs/SharePipeline/UndoSharePipeline.php index d63f909b..6d39dfa3 100644 --- a/app/Jobs/SharePipeline/UndoSharePipeline.php +++ b/app/Jobs/SharePipeline/UndoSharePipeline.php @@ -37,7 +37,7 @@ class UndoSharePipeline implements ShouldQueue if($parent) { $target = $parent->profile_id; - ReblogService::removePostReblog($parent->id, $status->id); + ReblogService::removePostReblog($parent->profile_id, $status->id); if($parent->reblogs_count > 0) { $parent->reblogs_count = $parent->reblogs_count - 1; diff --git a/app/Util/ActivityPub/Inbox.php b/app/Util/ActivityPub/Inbox.php index 6b658643..7ea1eb8a 100644 --- a/app/Util/ActivityPub/Inbox.php +++ b/app/Util/ActivityPub/Inbox.php @@ -37,6 +37,7 @@ use App\Util\ActivityPub\Validator\UndoFollow as UndoFollowValidator; use App\Services\PollService; use App\Services\FollowerService; +use App\Services\ReblogService; use App\Services\StatusService; use App\Services\UserFilterService; use App\Services\NetworkTimelineService; @@ -602,6 +603,8 @@ class Inbox $parent->reblogs_count = $parent->reblogs_count + 1; $parent->save(); + ReblogService::addPostReblog($parent->profile_id, $status->id); + return; } @@ -789,17 +792,23 @@ class Inbox if(is_array($obj) && isset($obj['object'])) { $obj = $obj['object']; } - if(!is_string($obj) || !Helpers::validateLocalUrl($obj)) { + if(!is_string($obj)) { return; } - $status = Status::whereUri($obj)->exists(); + if(Helpers::validateLocalUrl($obj)) { + $parsedId = last(explode('/', $obj)); + $status = Status::find($parsedId); + } else { + $status = Status::whereUri($obj)->first(); + } if(!$status) { return; } Status::whereProfileId($profile->id) ->whereReblogOfId($status->id) - ->forceDelete(); - Notification::whereProfileId($status->profile->id) + ->delete(); + ReblogService::removePostReblog($profile->id, $status->id); + Notification::whereProfileId($status->profile_id) ->whereActorId($profile->id) ->whereAction('share') ->whereItemId($status->reblog_of_id)