]> git.mxchange.org Git - friendica.git/commitdiff
Replace "hidewall" with "net-publish" / other "hidewall" stuff
authorMichael <heluecht@pirati.ca>
Thu, 20 Feb 2020 17:24:41 +0000 (17:24 +0000)
committerMichael <heluecht@pirati.ca>
Thu, 20 Feb 2020 17:24:41 +0000 (17:24 +0000)
mod/msearch.php
mod/poco.php
src/Model/Contact.php

index 48476da4f06542a00d3c101202233c4e035d7543..b02a036ae4e1996dc4a6853892b77b6b4df71724 100644 (file)
@@ -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,
index 96607552e0766885cae3255888e20e75f4619f6d..f04ec42790f1a08b37fdd80dc2122ce07a331cdb 100644 (file)
@@ -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) {
index b696cfa7f3abe3ca11995755f7ae5b4e8256046d..f86d3f378c448710eaf37dfee9ab01712a3528a5 100644 (file)
@@ -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;