From 004246163dd4482ae1d0d442d30256db8ed1535a Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 31 Jan 2019 18:39:07 +0100 Subject: starring and filing is only supported for post item type --- Zotlabs/Lib/ThreadItem.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Zotlabs/Lib/ThreadItem.php') diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php index 83d243177..dc84df316 100644 --- a/Zotlabs/Lib/ThreadItem.php +++ b/Zotlabs/Lib/ThreadItem.php @@ -411,9 +411,9 @@ class ThreadItem { 'rawmid' => $item['mid'], 'plink' => get_plink($item), 'edpost' => $edpost, // ((feature_enabled($conv->get_profile_owner(),'edit_posts')) ? $edpost : ''), - 'star' => ((feature_enabled($conv->get_profile_owner(),'star_posts')) ? $star : ''), + 'star' => ((feature_enabled($conv->get_profile_owner(),'star_posts') && ($item['item_type'] == ITEM_TYPE_POST)) ? $star : ''), 'tagger' => ((feature_enabled($conv->get_profile_owner(),'commtag')) ? $tagger : ''), - 'filer' => ((feature_enabled($conv->get_profile_owner(),'filing')) ? $filer : ''), + 'filer' => ((feature_enabled($conv->get_profile_owner(),'filing') && ($item['item_type'] == ITEM_TYPE_POST)) ? $filer : ''), 'bookmark' => (($conv->get_profile_owner() == local_channel() && local_channel() && $has_bookmarks) ? t('Save Bookmarks') : ''), 'addtocal' => (($has_event) ? t('Add to Calendar') : ''), 'drop' => $drop, -- cgit v1.2.3 From ad4dd2def58999c58fc12def0e6b5789597f5581 Mon Sep 17 00:00:00 2001 From: "M. Dent" Date: Fri, 1 Feb 2019 09:29:59 +0100 Subject: Set lock red and provide warning if a forum is tagged in the post --- Zotlabs/Lib/ThreadItem.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Zotlabs/Lib/ThreadItem.php') diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php index dc84df316..7ce0d0f9e 100644 --- a/Zotlabs/Lib/ThreadItem.php +++ b/Zotlabs/Lib/ThreadItem.php @@ -101,6 +101,7 @@ class ThreadItem { || strlen($item['deny_cid']) || strlen($item['deny_gid'])))) ? t('Private Message') : false); + $shareable = ((($conv->get_profile_owner() == local_channel() && local_channel()) && ($item['item_private'] != 1)) ? true : false); // allow an exemption for sharing stuff from your private feeds @@ -115,6 +116,16 @@ class ThreadItem { $privacy_warning = true; } + if ($lock) { + if (count(get_terms_oftype($item['term'],TERM_FORUM))) { + $privacy_warning = true; + } + } + + if ($lock && $privacy_warning) { + $lock = t('Privacy conflict. Discretion advised.'); + } + $mode = $conv->get_mode(); switch($item['item_type']) { -- cgit v1.2.3 From 29c1797493f44d2677cab9b35ce6d879f020a15e Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 6 Feb 2019 17:26:09 -0800 Subject: work on repeat/share for Hubzilla --- Zotlabs/Lib/ThreadItem.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Zotlabs/Lib/ThreadItem.php') diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php index 83d243177..6c4deea27 100644 --- a/Zotlabs/Lib/ThreadItem.php +++ b/Zotlabs/Lib/ThreadItem.php @@ -293,8 +293,10 @@ class ThreadItem { $dislike = array( t("I don't like this \x28toggle\x29"), t("dislike")); } - if ($shareable) - $share = array( t('Share This'), t('share')); + if ($shareable) { + $share = array( t('Repeat This'), t('repeat')); + $embed = array( t('Share This'), t('share')); + } $dreport = ''; @@ -408,6 +410,7 @@ class ThreadItem { 'like' => $like, 'dislike' => ((feature_enabled($conv->get_profile_owner(),'dislike')) ? $dislike : ''), 'share' => $share, + 'embed' => $embed, 'rawmid' => $item['mid'], 'plink' => get_plink($item), 'edpost' => $edpost, // ((feature_enabled($conv->get_profile_owner(),'edit_posts')) ? $edpost : ''), -- cgit v1.2.3 From 317c53acf6b74a4f92284074017985fb09662a46 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 7 Feb 2019 14:38:05 -0800 Subject: disable repeat unless mid is a resolvable uri since this will do radically different things on different network stacks (e.g. Diaspora) and it turns out there is no possible way to make Diaspora reshares compatible with ActivityPub or Zot6 repeat/announce/boost/whatever. --- Zotlabs/Lib/ThreadItem.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Zotlabs/Lib/ThreadItem.php') diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php index 6c4deea27..94d0e3cf8 100644 --- a/Zotlabs/Lib/ThreadItem.php +++ b/Zotlabs/Lib/ThreadItem.php @@ -294,7 +294,11 @@ class ThreadItem { } if ($shareable) { - $share = array( t('Repeat This'), t('repeat')); + // This actually turns out not to be possible in some protocol stacks without opening up hundreds of new issues. + // Will allow it only for uri resolvable sources. + if(strpos($item['mid'],'http') === 0) { + $share = array( t('Repeat This'), t('repeat')); + } $embed = array( t('Share This'), t('share')); } -- cgit v1.2.3 From 5b3ea012ab0712cd6f02fe9cb07e75f2c4b5954a Mon Sep 17 00:00:00 2001 From: "M.Dent" Date: Tue, 12 Feb 2019 22:05:57 -0500 Subject: Fix: only first lock red with privacy_warning --- Zotlabs/Lib/ThreadItem.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'Zotlabs/Lib/ThreadItem.php') diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php index bdbfc4385..323f84acf 100644 --- a/Zotlabs/Lib/ThreadItem.php +++ b/Zotlabs/Lib/ThreadItem.php @@ -76,7 +76,7 @@ class ThreadItem { * _ false on failure */ - public function get_template_data($conv_responses, $thread_level=1) { + public function get_template_data($conv_responses, $thread_level=1, $conv_flags = []) { $result = array(); @@ -117,11 +117,17 @@ class ThreadItem { } if ($lock) { - if (count(get_terms_oftype($item['term'],TERM_FORUM))) { + if (($item['mid'] == $item['parent_mid']) && count(get_terms_oftype($item['term'],TERM_FORUM))) { $privacy_warning = true; } } + if ($privacy_warning) { + $conv_flags['privacy_warning'] = $privacy_warning; + } else { + $privacy_warning = (isset($conv_flags['privacy_warning'])) ? $conv_flags['privacy_warning'] : false; + } + if ($lock && $privacy_warning) { $lock = t('Privacy conflict. Discretion advised.'); } @@ -488,7 +494,7 @@ class ThreadItem { if(($this->get_display_mode() === 'normal') && ($nb_children > 0)) { foreach($children as $child) { - $result['children'][] = $child->get_template_data($conv_responses, $thread_level + 1); + $result['children'][] = $child->get_template_data($conv_responses, $thread_level + 1,$conv_flags); } // Collapse if(($nb_children > $visible_comments) || ($thread_level > 1)) { -- cgit v1.2.3 From c3e2b463e4604d5bb148ebbaa97b68ca33ce89e1 Mon Sep 17 00:00:00 2001 From: "M.Dent" Date: Wed, 13 Feb 2019 08:26:03 -0500 Subject: Only cascade privacy warning if thread parent has privacy concerns. --- Zotlabs/Lib/ThreadItem.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'Zotlabs/Lib/ThreadItem.php') diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php index 323f84acf..04265ee5a 100644 --- a/Zotlabs/Lib/ThreadItem.php +++ b/Zotlabs/Lib/ThreadItem.php @@ -119,14 +119,11 @@ class ThreadItem { if ($lock) { if (($item['mid'] == $item['parent_mid']) && count(get_terms_oftype($item['term'],TERM_FORUM))) { $privacy_warning = true; + $conv_flags['parent_privacy_warning'] = true; } } - if ($privacy_warning) { - $conv_flags['privacy_warning'] = $privacy_warning; - } else { - $privacy_warning = (isset($conv_flags['privacy_warning'])) ? $conv_flags['privacy_warning'] : false; - } + $privacy_warning = (isset($conv_flags['parent_privacy_warning'])) ? $conv_flags['parent_privacy_warning'] : $privacy_warning; if ($lock && $privacy_warning) { $lock = t('Privacy conflict. Discretion advised.'); -- cgit v1.2.3 From 0207b5ba8b60da0d87d32963f462254d51faddca Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 14 Feb 2019 11:32:43 +0100 Subject: disable repeats until issues are resolved --- Zotlabs/Lib/ThreadItem.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Zotlabs/Lib/ThreadItem.php') diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php index 04265ee5a..40c0fca4b 100644 --- a/Zotlabs/Lib/ThreadItem.php +++ b/Zotlabs/Lib/ThreadItem.php @@ -311,7 +311,8 @@ class ThreadItem { // This actually turns out not to be possible in some protocol stacks without opening up hundreds of new issues. // Will allow it only for uri resolvable sources. if(strpos($item['mid'],'http') === 0) { - $share = array( t('Repeat This'), t('repeat')); + $share = []; //Not yet ready for primetime + //$share = array( t('Repeat This'), t('repeat')); } $embed = array( t('Share This'), t('share')); } -- cgit v1.2.3