From eb992e8a98d9eba32bf9b84598a840edab1bf345 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 10 Jan 2024 21:51:34 +0000 Subject: [PATCH] Code clean up --- .../Repository/UserDefinedChannel.php | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/Content/Conversation/Repository/UserDefinedChannel.php b/src/Content/Conversation/Repository/UserDefinedChannel.php index 37e3ff06ff..e11a7d0abe 100644 --- a/src/Content/Conversation/Repository/UserDefinedChannel.php +++ b/src/Content/Conversation/Repository/UserDefinedChannel.php @@ -217,11 +217,7 @@ class UserDefinedChannel extends \Friendica\BaseRepository if (empty($users)) { return []; } - return $this->getMatches($searchtext, $language, $tags, $media_type, $owner_id, $reshare_id, array_column($users, 'uid'), true); - } - private function getMatches(string $searchtext, string $language, array $tags, int $media_type, int $owner_id, int $reshare_id, array $channelUids, bool $relayMode): array - { if (!in_array($language, User::getLanguages())) { $this->logger->debug('Unwanted language found. No matched channel found.', ['language' => $language, 'searchtext' => $searchtext]); return []; @@ -231,14 +227,7 @@ class UserDefinedChannel extends \Friendica\BaseRepository $uids = []; - $condition = ['uid' => $channelUids, 'valid' => true]; - if (!$relayMode) { - $condition = DBA::mergeConditions($condition, ["`full-text-search` != ?", '']); - } else { - $condition = DBA::mergeConditions($condition, ['publish' => true]); - } - - foreach ($this->select($condition) as $channel) { + foreach ($this->select(['uid' => array_column($users, 'uid'), 'publish' => true, 'valid' => true]) as $channel) { if (in_array($channel->uid, $uids)) { continue; } @@ -276,9 +265,6 @@ class UserDefinedChannel extends \Friendica\BaseRepository } $uids[] = $channel->uid; $this->logger->debug('Matching channel found.', ['uid' => $channel->uid, 'label' => $channel->label, 'language' => $language, 'tags' => $tags, 'media_type' => $media_type, 'searchtext' => $searchtext]); - if (!$relayMode) { - return $uids; - } } $this->db->delete('check-full-text-search', ['pid' => getmypid()]); -- 2.39.5