]> git.mxchange.org Git - friendica.git/commitdiff
Olq query removed, checking for deleted as well
authorMichael <heluecht@pirati.ca>
Wed, 13 Oct 2021 05:11:36 +0000 (05:11 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 13 Oct 2021 05:11:36 +0000 (05:11 +0000)
mod/msearch.php
src/Model/Contact.php

index ce440d1ee25c86cf0a9164e8dbd8fd9d3b14124a..969446ffb524968f77f0acf1afd2528832abf23a 100644 (file)
@@ -45,20 +45,6 @@ function msearch_post(App $a)
 
        $condition = ["`net-publish` AND MATCH(`pub_keywords`) AGAINST (?)", $search];
        $total = DBA::count('owner-view', $condition);
-       $count_stmt = DBA::p(
-               "SELECT COUNT(*) AS `total`
-                       FROM `profile`
-                       JOIN `user` ON `user`.`uid` = `profile`.`uid`
-                       WHERE `profile`.`net-publish`
-                       AND MATCH(`pub_keywords`) AGAINST (?)",
-               $search
-       );
-       if (DBA::isResult($count_stmt)) {
-               $row = DBA::fetch($count_stmt);
-               $total = $row['total'];
-       }
-
-       DBA::close($count_stmt);
 
        $search_stmt = DBA::select('owner-view', ['pub_keywords', 'name', 'nickname', 'uid'], $condition, ['limit' => [$startrec, $perpage]]);
        while ($search_result = DBA::fetch($search_stmt)) {
index 93414d0ff9b29d2d7d16c6d343b00df8fe5248b8..236c0b9b9997a7da633a90afbefc7cd22fd5649c 100644 (file)
@@ -3022,7 +3022,7 @@ class Contact
                        $networks[] = Protocol::OSTATUS;
                }
 
-               $condition = ['network' => $networks, 'failed' => false, 'uid' => $uid];
+               $condition = ['network' => $networks, 'failed' => false, 'deleted' => false, 'uid' => $uid];
 
                // check if we search only communities or every contact
                if ($mode === 'community') {
@@ -3032,7 +3032,7 @@ class Contact
                $search .= '%';
 
                $condition = DBA::mergeConditions($condition,
-                       ["(NOT `unsearchable` OR `nurl` IN (SELECT `nurl` FROM `owner-view` where `publish` OR `net-publish`))
+                       ["(NOT `unsearchable` OR `nurl` IN (SELECT `nurl` FROM `owner-view` WHERE `publish` OR `net-publish`))
                        AND (`addr` LIKE ? OR `name` LIKE ? OR `nick` LIKE ?)", $search, $search, $search]);
 
                $contacts = self::selectToArray([], $condition);