From 1d358fe6ded6517ef6186554c4bb9c5f2f3ffe1c Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 28 Apr 2013 21:02:53 -0700 Subject: [PATCH] system support for complete blocking --- include/conversation.php | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/include/conversation.php b/include/conversation.php index 36ac57f17..2e336efab 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -377,6 +377,18 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { $page_writeable = false; $live_update_div = ''; + $arr_blocked = null; + + if(local_user()) { + $str_blocked = get_pconfig(local_user(),'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]); + } + + } + $previewing = (($preview) ? ' preview ' : ''); if($mode === 'network') { @@ -493,6 +505,19 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { $tpl = 'search_item.tpl'; foreach($items as $item) { + if($arr_blocked) { + $blocked = false; + foreach($arr_blocked as $b) { + if($b && link_compare($item['author-link'],$b)) { + $blocked = true; + break; + } + } + if($blocked) + continue; + } + + $threadsid++; $comment = ''; @@ -691,6 +716,21 @@ function conversation(&$a, $items, $mode, $update, $preview = false) { $threads = array(); foreach($items as $item) { + if($arr_blocked) { + $blocked = false; + foreach($arr_blocked as $b) { + + if($b && link_compare($item['author-link'],$b)) { + $blocked = true; + break; + } + } + if($blocked) + continue; + } + + + // Can we put this after the visibility check? like_puller($a,$item,$alike,'like'); like_puller($a,$item,$dlike,'dislike');