From 0905018d3b3b02def2b0e69e9bc4c4ef2b2b86aa Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 14 Mar 2018 14:51:33 -0700 Subject: use original exif_read_data() parameters which were lost in a regression; unset automatic nsfw category generated for Mastodon content warning posts, as people use CW as a spoiler mechanism 99% of the time and flagging inappropriate content 1% of the time. --- include/feedutils.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/feedutils.php') diff --git a/include/feedutils.php b/include/feedutils.php index 369193fce..4864a6ef5 100644 --- a/include/feedutils.php +++ b/include/feedutils.php @@ -668,6 +668,14 @@ function get_atom_elements($feed, $item) { } $termterm = notags(trim(unxmlify($term))); + // Mastodon auto generates an nsfw category tag for any 'content-warning' message. + // Most people use CW and use both summary/content as a spoiler and we honour that + // construct so the post will already be collapsed. The generated tag is almost + // always wrong and even if it isn't we would already be doing the right thing. + + if($mastodon && $termterm === 'nsfw') + continue; + if($termterm) { $terms[] = array( 'otype' => TERM_OBJ_POST, -- cgit v1.2.3 From a94a28bb7e2df6e8438deed9f0fb0e22682e61cc Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 14 Mar 2018 20:47:11 -0700 Subject: mastodon content-warning cont: only strip nsfw tag if a content warning spoiler is used. Else it's legitimately nsfw. --- include/feedutils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/feedutils.php') diff --git a/include/feedutils.php b/include/feedutils.php index 4864a6ef5..62e1299a4 100644 --- a/include/feedutils.php +++ b/include/feedutils.php @@ -673,7 +673,7 @@ function get_atom_elements($feed, $item) { // construct so the post will already be collapsed. The generated tag is almost // always wrong and even if it isn't we would already be doing the right thing. - if($mastodon && $termterm === 'nsfw') + if($mastodon && $termterm === 'nsfw' && $summary && $res['body']) continue; if($termterm) { -- cgit v1.2.3 From 91b710b07d5fc2b48b5d56d1801a36532008d1e9 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 15 Mar 2018 17:51:24 -0700 Subject: add auth flag to share attributes so we can make a costly determination to use zid at post submission time instead of making multiple calls to is_matrix_url() at render time --- include/feedutils.php | 1 + 1 file changed, 1 insertion(+) (limited to 'include/feedutils.php') diff --git a/include/feedutils.php b/include/feedutils.php index 62e1299a4..023caaad6 100644 --- a/include/feedutils.php +++ b/include/feedutils.php @@ -934,6 +934,7 @@ function feed_get_reshare(&$res,$item) { "' profile='" . $share['profile'] . "' avatar='" . $share['avatar'] . "' link='" . $share['alternate'] . + "' auth='" . 'false' . "' posted='" . $share['created'] . "' message_id='" . $share['message_id'] . "']"; -- cgit v1.2.3