From 9a89a2b751be2711926fd0a381c2ccf8a3b32839 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Fri, 2 Dec 2022 02:30:19 -0700 Subject: [PATCH] Update AP helpers --- app/Util/ActivityPub/Helpers.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Util/ActivityPub/Helpers.php b/app/Util/ActivityPub/Helpers.php index 1516478d0..d49ff0cdd 100644 --- a/app/Util/ActivityPub/Helpers.php +++ b/app/Util/ActivityPub/Helpers.php @@ -496,7 +496,8 @@ class Helpers { $status->in_reply_to_id === null && $status->reblog_of_id === null && in_array($status->type, ['photo', 'photo:album', 'video', 'video:album', 'photo:video:album']) && - $status->created_at->gt(now()->subHours(config('instance.timeline.network.max_hours_old'))) + $status->created_at->gt(now()->subHours(config('instance.timeline.network.max_hours_old'))) && + (config('instance.hide_nsfw_on_public_feeds') == true ? $status->is_nsfw == false : true) ) { NetworkTimelineService::add($status->id); } @@ -544,7 +545,7 @@ class Helpers { public static function getScope($activity, $url) { $id = isset($activity['id']) ? self::pluckval($activity['id']) : self::pluckval($url); - $url = isset($activity['url']) ? self::pluckval($activity['url']) : $id; + $url = isset($activity['url']) ? self::pluckval($activity['url']) : self::pluckval($id); $urlDomain = parse_url($url, PHP_URL_HOST); $scope = 'private';