From 340f5e627c85c29fceebe5a6bff2fa373f29d07d Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 23 Mar 2024 06:59:13 +0000 Subject: [PATCH] Bluesky: Added support for sensitive posts --- bluesky/bluesky.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bluesky/bluesky.php b/bluesky/bluesky.php index 2cd2d263..4a1f4f60 100644 --- a/bluesky/bluesky.php +++ b/bluesky/bluesky.php @@ -1222,6 +1222,17 @@ function bluesky_get_header(stdClass $post, string $uri, int $uid, int $fetch_ui $item['post-reason'] = Item::PR_FOLLOWER; } + if (!empty($post->labels)) { + foreach ($post->labels as $label) { + // Only flag posts as sensitive based on labels that had been provided by the author. + // When "ver" is set to "1" it was flagged by some automated process. + if (empty($label->ver)) { + $item['sensitive'] = true; + Logger::debug('Sensitive content', ['uri-id' => $item['uri-id'], 'label' => $label]); + } + } + } + return $item; } -- 2.43.5