diff options
author | zotlabs <mike@macgirvin.com> | 2017-06-13 19:52:16 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-06-13 19:52:16 -0700 |
commit | 364da7a57e4fea5226c83d2ef9869a084c7c0013 (patch) | |
tree | 4a279474e54b392316750fe4f7f826f6b35adc73 /include | |
parent | 05eeb8432e3dcb6abfcca89351245da632aad39e (diff) | |
download | volse-hubzilla-364da7a57e4fea5226c83d2ef9869a084c7c0013.tar.gz volse-hubzilla-364da7a57e4fea5226c83d2ef9869a084c7c0013.tar.bz2 volse-hubzilla-364da7a57e4fea5226c83d2ef9869a084c7c0013.zip |
support mastodon content warnings by converting into n-s-f-w tag
Diffstat (limited to 'include')
-rw-r--r-- | include/feedutils.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/feedutils.php b/include/feedutils.php index 38ad102b4..96e5fdc6b 100644 --- a/include/feedutils.php +++ b/include/feedutils.php @@ -266,6 +266,8 @@ function get_atom_elements($feed, $item, &$author) { $res['item_rss'] = 1; + $summary = unxmlify($item->get_description(true)); + // removing the content of the title if its identically to the body // 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'); if($private && intval($private[0]['data']) > 0) $res['item_private'] = ((intval($private[0]['data'])) ? 1 : 0); |