From d03fb894944520858305f5f45a241dd5ae00329a Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 20 Feb 2020 17:24:41 +0000 Subject: [PATCH] Replace "hidewall" with "net-publish" / other "hidewall" stuff --- mod/msearch.php | 4 ++-- mod/poco.php | 14 ++++++-------- src/Model/Contact.php | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/mod/msearch.php b/mod/msearch.php index 48476da4f0..b02a036ae4 100644 --- a/mod/msearch.php +++ b/mod/msearch.php @@ -45,7 +45,7 @@ function msearch_post(App $a) "SELECT COUNT(*) AS `total` FROM `profile` JOIN `user` ON `user`.`uid` = `profile`.`uid` - WHERE `user`.`hidewall` = 0 + WHERE `profile`.`net-publish` AND MATCH(`pub_keywords`) AGAINST (?)", $search ); @@ -60,7 +60,7 @@ function msearch_post(App $a) "SELECT `pub_keywords`, `username`, `nickname`, `user`.`uid` FROM `user` JOIN `profile` ON `user`.`uid` = `profile`.`uid` - WHERE `user`.`hidewall` = 0 + WHERE `profile`.`net-publish` AND MATCH(`pub_keywords`) AGAINST (?) LIMIT ?, ?", $search, diff --git a/mod/poco.php b/mod/poco.php index 96607552e0..f04ec42790 100644 --- a/mod/poco.php +++ b/mod/poco.php @@ -80,16 +80,14 @@ function poco_init(App $a) { $cid = intval($a->argv[4]); } - if (! $system_mode && ! $global) { - $users = q("SELECT `user`.*,`profile`.`hide-friends` from user left join profile on `user`.`uid` = `profile`.`uid` - where `user`.`nickname` = '%s' limit 1", - DBA::escape($nickname) - ); - if (! DBA::isResult($users) || $users[0]['hidewall'] || $users[0]['hide-friends']) { + if (!$system_mode && !$global) { + $user = DBA::fetchFirst("SELECT `user`.`uid`, `user`.`nickname` FROM `user` + INNER JOIN `profile` ON `user`.`uid` = `profile`.`uid` + WHERE `user`.`nickname` = ? AND NOT `profile`.`hide-friends`", + $nickname); + if (!DBA::isResult($user)) { throw new \Friendica\Network\HTTPException\NotFoundException(); } - - $user = $users[0]; } if ($justme) { diff --git a/src/Model/Contact.php b/src/Model/Contact.php index b696cfa7f3..f86d3f378c 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -704,7 +704,7 @@ class Contact return; } - $fields = ['nickname', 'page-flags', 'account-type', 'hidewall']; + $fields = ['nickname', 'page-flags', 'account-type']; $user = DBA::selectFirst('user', $fields, ['uid' => $uid]); if (!DBA::isResult($user)) { return;