diff options
author | M.Dent <dentm42@dm42.net> | 2019-02-12 22:05:57 -0500 |
---|---|---|
committer | M.Dent <dentm42@dm42.net> | 2019-02-12 22:05:57 -0500 |
commit | 5b3ea012ab0712cd6f02fe9cb07e75f2c4b5954a (patch) | |
tree | d9798dceed91346e43ae68b616ba2a826cd654fb /Zotlabs/Lib/ThreadItem.php | |
parent | 07df43aa2a8d51f75c60733243e8d4a610daa0d1 (diff) | |
download | volse-hubzilla-5b3ea012ab0712cd6f02fe9cb07e75f2c4b5954a.tar.gz volse-hubzilla-5b3ea012ab0712cd6f02fe9cb07e75f2c4b5954a.tar.bz2 volse-hubzilla-5b3ea012ab0712cd6f02fe9cb07e75f2c4b5954a.zip |
Fix: only first lock red with privacy_warning
Diffstat (limited to 'Zotlabs/Lib/ThreadItem.php')
-rw-r--r-- | Zotlabs/Lib/ThreadItem.php | 12 |
1 files changed, 9 insertions, 3 deletions
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)) { |