From 62975b0ef247f0b7ade214fddce62060e90ed4e3 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 11 Jan 2024 20:40:24 +0000 Subject: [PATCH] Simplify SQL check --- src/Content/Conversation/Repository/UserDefinedChannel.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Content/Conversation/Repository/UserDefinedChannel.php b/src/Content/Conversation/Repository/UserDefinedChannel.php index e11a7d0abe..a74bdb06d3 100644 --- a/src/Content/Conversation/Repository/UserDefinedChannel.php +++ b/src/Content/Conversation/Repository/UserDefinedChannel.php @@ -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; } /**