aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-06-13 19:52:16 -0700
committerMario Vavti <mario@mariovavti.com>2017-06-14 16:57:39 +0200
commit70e912736f10bb8eaf8978689ae0183f7970043c (patch)
treeb79a038312228199db950289e5f4f9507db823fa
parentec1156d37a5d36136cc2b591248d65c5b826db2a (diff)
downloadvolse-hubzilla-70e912736f10bb8eaf8978689ae0183f7970043c.tar.gz
volse-hubzilla-70e912736f10bb8eaf8978689ae0183f7970043c.tar.bz2
volse-hubzilla-70e912736f10bb8eaf8978689ae0183f7970043c.zip
support mastodon content warnings by converting into n-s-f-w tag
-rw-r--r--include/feedutils.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/feedutils.php b/include/feedutils.php
index 156a78a39..c9c7522b1 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);