From c9cce9873d8c0a535068d9016cf2688a197fcb72 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 27 Jan 2013 13:14:13 -0800 Subject: [PATCH] search privacy enhancements for those with blocked walls --- mod/item.php | 4 ++++ mod/search.php | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/mod/item.php b/mod/item.php index 2ed1b812a4..05b3395fdb 100644 --- a/mod/item.php +++ b/mod/item.php @@ -248,6 +248,10 @@ function item_post(&$a) { $private = ((strlen($str_group_allow) || strlen($str_contact_allow) || strlen($str_group_deny) || strlen($str_contact_deny)) ? 1 : 0); + + if($user['hidewall']) + $private = 2; + // If this is a comment, set the permissions from the parent. if($parent_item) { diff --git a/mod/search.php b/mod/search.php index 956816fed0..2753c2e1e5 100644 --- a/mod/search.php +++ b/mod/search.php @@ -149,7 +149,7 @@ function search_content(&$a) { FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` LEFT JOIN `user` ON `user`.`uid` = `item`.`uid` WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0 AND (( `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' AND `item`.`private` = 0 AND `user`.`hidewall` = 0) - OR `item`.`uid` = %d ) + OR ( `item`.`uid` = %d )) AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 $sql_extra group by `item`.`uri` ", intval(local_user()) @@ -168,12 +168,12 @@ function search_content(&$a) { `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`alias`, `contact`.`rel`, `contact`.`network`, `contact`.`thumb`, `contact`.`self`, `contact`.`writable`, `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`, - `user`.`nickname` + `user`.`nickname`, `user`.`uid`, `user`.`hidewall` FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` LEFT JOIN `user` ON `user`.`uid` = `item`.`uid` WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0 AND (( `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' AND `item`.`private` = 0 AND `user`.`hidewall` = 0 ) - OR `item`.`uid` = %d ) + OR ( `item`.`uid` = %d )) AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 $sql_extra group by `item`.`uri` -- 2.39.5