summaryrefslogtreecommitdiffstats
path: root/lib/Service/SearchService.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Service/SearchService.php')
-rw-r--r--lib/Service/SearchService.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Service/SearchService.php b/lib/Service/SearchService.php
index 9dacaa34..3ae3df86 100644
--- a/lib/Service/SearchService.php
+++ b/lib/Service/SearchService.php
@@ -31,15 +31,22 @@ declare(strict_types=1);
namespace OCA\Social\Service;
+use daita\MySmallPhpTools\Traits\Nextcloud\nc20\TNC20Logger;
use daita\MySmallPhpTools\Traits\TArrayTools;
use Exception;
use OCA\Social\Model\ActivityPub\Actor\Person;
+/**
+ * Class SearchService
+ *
+ * @package OCA\Social\Service
+ */
class SearchService {
use TArrayTools;
+ use TNC20Logger;
const SEARCH_ACCOUNTS = 1;
@@ -88,6 +95,7 @@ class SearchService {
public function searchAccounts(string $search): array {
$result = [];
$type = $this->getTypeFromSearch($search);
+
if ($search === '' || !$type & self::SEARCH_ACCOUNTS) {
return $result;
}
@@ -99,6 +107,7 @@ class SearchService {
try {
$this->cacheActorService->getFromAccount($search);
} catch (Exception $e) {
+ $this->exception($e, self::$NOTICE, ['search' => $search]);
}
return $this->cacheActorService->searchCachedAccounts($search);