From: friendica Date: Mon, 29 Apr 2013 04:02:53 +0000 (-0700) Subject: system support for complete blocking X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=1d358fe6ded6517ef6186554c4bb9c5f2f3ffe1c;p=friendica.git system support for complete blocking --- diff --git a/include/conversation.php b/include/conversation.php index 36ac57f17d..2e336efab0 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');