mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-11-24 13:03:41 +00:00
Bluesky: Added support for sensitive posts
This commit is contained in:
parent
9153ca05fd
commit
340f5e627c
1 changed files with 11 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue