]> git.mxchange.org Git - friendica.git/commitdiff
Simplify SQL check
authorMichael <heluecht@pirati.ca>
Thu, 11 Jan 2024 20:40:24 +0000 (20:40 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 28 Jan 2024 15:37:43 +0000 (16:37 +0100)
src/Content/Conversation/Repository/UserDefinedChannel.php

index e11a7d0abe019ec44e18b85c2ecf35405f851bc9..a74bdb06d39479b4b3c76500f741bf4bc855c2ea 100644 (file)
@@ -156,10 +156,7 @@ class UserDefinedChannel extends \Friendica\BaseRepository
                        return true;
                }
 
-               $this->db->insert('check-full-text-search', ['pid' => getmypid(), 'searchtext' => $searchtext], Database::INSERT_UPDATE);
-               $result = $this->db->select('check-full-text-search', [], ["`pid` = ? AND MATCH (`searchtext`) AGAINST (? IN BOOLEAN MODE)", getmypid(), $this->escapeKeywords($searchtext)]);
-               $this->db->delete('check-full-text-search', ['pid' => getmypid()]);
-               return $result !== false;
+               return $this->db->select('check-full-text-search', [], ["`pid` = ? AND MATCH (`searchtext`) AGAINST (? IN BOOLEAN MODE)", getmypid(), $this->escapeKeywords($searchtext)]) !== false;
        }
 
        /**