summaryrefslogtreecommitdiffstats
path: root/lib/Service
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2019-08-01 12:04:38 -0100
committerMaxence Lange <maxence@artificial-owl.com>2019-08-01 12:04:38 -0100
commit8b7ecde8ef027e359f89194aa6f8f6a16e5f8fdb (patch)
tree9458e23548d0d07df25b9d8ba4b535e3f146db62 /lib/Service
parente08c50ff9af6af6327b47bb70e01c528cbd072dd (diff)
returns limited results
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib/Service')
-rw-r--r--lib/Service/HashtagService.php11
-rw-r--r--lib/Service/SearchService.php2
2 files changed, 10 insertions, 3 deletions
diff --git a/lib/Service/HashtagService.php b/lib/Service/HashtagService.php
index d463502a..3fc42372 100644
--- a/lib/Service/HashtagService.php
+++ b/lib/Service/HashtagService.php
@@ -36,6 +36,8 @@ use OCA\Social\Db\HashtagsRequest;
use OCA\Social\Db\StreamRequest;
use OCA\Social\Exceptions\DateTimeException;
use OCA\Social\Exceptions\HashtagDoesNotExistException;
+use OCA\Social\Exceptions\ItemUnknownException;
+use OCA\Social\Exceptions\SocialAppConfigException;
use OCA\Social\Model\ActivityPub\Object\Note;
use OCA\Social\Model\ActivityPub\Stream;
@@ -100,6 +102,8 @@ class HashtagService {
/**
* @return int
* @throws DateTimeException
+ * @throws ItemUnknownException
+ * @throws SocialAppConfigException
*/
public function manageHashtags(): int {
$current = $this->hashtagsRequest->getAll();
@@ -146,11 +150,12 @@ class HashtagService {
/**
* @param string $hashtag
+ * @param bool $all
*
* @return array
*/
- public function searchHashtags(string $hashtag): array {
- return $this->hashtagsRequest->searchHashtags($hashtag);
+ public function searchHashtags(string $hashtag, bool $all = false): array {
+ return $this->hashtagsRequest->searchHashtags($hashtag, $all);
}
@@ -159,6 +164,8 @@ class HashtagService {
*
* @return Stream[]
* @throws DateTimeException
+ * @throws ItemUnknownException
+ * @throws SocialAppConfigException
*/
private function getTrendSince(int $timestamp): array {
$result = [];
diff --git a/lib/Service/SearchService.php b/lib/Service/SearchService.php
index e30d9b81..db033cea 100644
--- a/lib/Service/SearchService.php
+++ b/lib/Service/SearchService.php
@@ -139,7 +139,7 @@ class SearchService {
}
try {
- $hashtags = $this->hashtagService->searchHashtags($search);
+ $hashtags = $this->hashtagService->searchHashtags($search, true);
$result['result'] = $hashtags;
} catch (Exception $e) {
}