mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 04:15:12 +00:00
support mastodon content warnings by converting into n-s-f-w tag
This commit is contained in:
parent
ec1156d37a
commit
70e912736f
1 changed files with 8 additions and 0 deletions
|
@ -266,6 +266,8 @@ function get_atom_elements($feed, $item, &$author) {
|
||||||
$res['item_rss'] = 1;
|
$res['item_rss'] = 1;
|
||||||
|
|
||||||
|
|
||||||
|
$summary = unxmlify($item->get_description(true));
|
||||||
|
|
||||||
// removing the content of the title if its identically to the body
|
// removing the content of the title if its identically to the body
|
||||||
// This helps with auto generated titles e.g. from tumblr
|
// This helps with auto generated titles e.g. from tumblr
|
||||||
|
|
||||||
|
@ -486,6 +488,12 @@ function get_atom_elements($feed, $item, &$author) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// turn Mastodon content warning into a #nsfw hashtag
|
||||||
|
if($mastodon && $summary) {
|
||||||
|
$res['body'] .= "\n\n#nsfw\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$private = $item->get_item_tags(NAMESPACE_DFRN, 'private');
|
$private = $item->get_item_tags(NAMESPACE_DFRN, 'private');
|
||||||
if($private && intval($private[0]['data']) > 0)
|
if($private && intval($private[0]['data']) > 0)
|
||||||
$res['item_private'] = ((intval($private[0]['data'])) ? 1 : 0);
|
$res['item_private'] = ((intval($private[0]['data'])) ? 1 : 0);
|
||||||
|
|
Loading…
Reference in a new issue