mirror of
https://github.com/friendica/friendica
synced 2025-05-10 01:04:09 +02:00
Issue 13845: Support "sensitive" attribute
This commit is contained in:
parent
d9d42105d6
commit
15df9990da
11 changed files with 53 additions and 28 deletions
|
@ -1697,18 +1697,6 @@ class Transmitter
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if the post contains sensitive content ("nsfw")
|
||||
*
|
||||
* @param integer $uri_id URI id
|
||||
* @return boolean Whether URI id was found
|
||||
* @throws \Exception
|
||||
*/
|
||||
private static function isSensitive(int $uri_id): bool
|
||||
{
|
||||
return DBA::exists('tag-view', ['uri-id' => $uri_id, 'name' => 'nsfw', 'type' => Tag::HASHTAG]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates event data
|
||||
*
|
||||
|
@ -1812,7 +1800,7 @@ class Transmitter
|
|||
} else {
|
||||
$data['attributedTo'] = $item['author-link'];
|
||||
}
|
||||
$data['sensitive'] = self::isSensitive($item['uri-id']);
|
||||
$data['sensitive'] = (bool)$item['sensitive'];
|
||||
|
||||
if (!empty($item['conversation']) && ($item['conversation'] != './')) {
|
||||
$data['conversation'] = $data['context'] = $item['conversation'];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue