diff options
author | zotlabs <mike@macgirvin.com> | 2016-12-11 16:27:43 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2016-12-11 16:27:43 -0800 |
commit | 0f7d36cfa0ed5896151078e305f4c2d2523f378c (patch) | |
tree | a351d56b014b6736490c791e791f9037d0794bba | |
parent | 9e27559bdb2ba2177128deb014ecaef21f1eaaba (diff) | |
download | volse-hubzilla-0f7d36cfa0ed5896151078e305f4c2d2523f378c.tar.gz volse-hubzilla-0f7d36cfa0ed5896151078e305f4c2d2523f378c.tar.bz2 volse-hubzilla-0f7d36cfa0ed5896151078e305f4c2d2523f378c.zip |
move the rest of superblock out of core
-rw-r--r-- | Zotlabs/Lib/ThreadItem.php | 2 | ||||
-rw-r--r-- | include/conversation.php | 60 |
2 files changed, 14 insertions, 48 deletions
diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php index 48b50b295..a1666e148 100644 --- a/Zotlabs/Lib/ThreadItem.php +++ b/Zotlabs/Lib/ThreadItem.php @@ -44,7 +44,7 @@ class ThreadItem { * Only add those that will be displayed */ - if((! visible_activity($item)) || array_key_exists('author_blocked',$item)) { + if((! visible_activity($item)) || array_key_exists('blocked',$item)) { continue; } diff --git a/include/conversation.php b/include/conversation.php index b9f390def..d367c27a6 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -473,22 +473,6 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ if (local_channel()) load_pconfig(local_channel(),''); - $arr_blocked = null; - - if (local_channel()) - $str_blocked = get_pconfig(local_channel(),'system','blocked'); - if (! local_channel() && ($mode == 'network')) { - $sys = get_sys_channel(); - $id = $sys['channel_id']; - $str_blocked = get_pconfig($id,'system','blocked'); - } - - if ($str_blocked) { - $arr_blocked = explode(',',$str_blocked); - for ($x = 0; $x < count($arr_blocked); $x ++) - $arr_blocked[$x] = trim($arr_blocked[$x]); - } - $profile_owner = 0; $page_writeable = false; $live_update_div = ''; @@ -615,17 +599,13 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ foreach($items as $item) { - if($arr_blocked) { - $blocked = false; - foreach($arr_blocked as $b) { - if(($b) && (($item['author_xchan'] == $b) || ($item['owner_xchan'] == $b))) { - $blocked = true; - break; - } - } - if($blocked) - continue; - } + $x = [ 'mode' => $mode, 'item' => $item ]; + call_hooks('stream_item',$x); + + if($x['item']['blocked']) + continue; + + $item = $x['item']; $threadsid++; @@ -787,28 +767,14 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ // Check for any blocked authors - if($arr_blocked) { - $blocked = false; - foreach($arr_blocked as $b) { - if(($b) && (($item['author_xchan'] == $b) || $item['owner_xchan'] == $b)) { - $blocked = true; - break; - } - } - if($blocked) - continue; - } - // Check all the kids too + $x = [ 'mode' => $mode, 'item' => $item ]; + call_hooks('stream_item',$x); + + if($x['item']['blocked']) + continue; - if($arr_blocked && $item['children']) { - for($d = 0; $d < count($item['children']); $d ++) { - foreach($arr_blocked as $b) { - if(($b) && (($item['children'][$d]['author_xchan'] == $b) || ($item['children'][$d]['owner_xchan'] == $b))) - $item['children'][$d]['author_blocked'] = true; - } - } - } + $item = $x['item']; builtin_activity_puller($item, $conv_responses); |