Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2020-08-04 11:00:27 +0300
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2020-08-04 22:36:22 +0300
commit71b62c4203a25beefeab73f73668919c813e3a50 (patch)
treee75b6b0338ed800ddf88bfe27ce6703045c18e48 /apps/comments/lib
parent6eced42b7a40f5b0ea0489244583219d0ee2e7af (diff)
Show mime icon, bump bundles, make the SearchResultEntry class non-abstract, Fix header search icon, various fixes
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/comments/lib')
-rw-r--r--apps/comments/lib/AppInfo/Application.php4
-rw-r--r--apps/comments/lib/Search/CommentsSearchProvider.php (renamed from apps/comments/lib/Search/Provider.php)21
-rw-r--r--apps/comments/lib/Search/CommentsSearchResultEntry.php31
3 files changed, 21 insertions, 35 deletions
diff --git a/apps/comments/lib/AppInfo/Application.php b/apps/comments/lib/AppInfo/Application.php
index 247ba034107..4eb097ff001 100644
--- a/apps/comments/lib/AppInfo/Application.php
+++ b/apps/comments/lib/AppInfo/Application.php
@@ -37,7 +37,7 @@ use OCA\Comments\Listener\LoadAdditionalScripts;
use OCA\Comments\Listener\LoadSidebarScripts;
use OCA\Comments\Notification\Notifier;
use OCA\Comments\Search\LegacyProvider;
-use OCA\Comments\Search\Provider;
+use OCA\Comments\Search\CommentsSearchProvider;
use OCA\Files\Event\LoadAdditionalScriptsEvent;
use OCA\Files\Event\LoadSidebar;
use OCP\AppFramework\App;
@@ -74,7 +74,7 @@ class Application extends App implements IBootstrap {
CommentsEntityEvent::EVENT_ENTITY,
CommentsEntityEventListener::class
);
- $context->registerSearchProvider(Provider::class);
+ $context->registerSearchProvider(CommentsSearchProvider::class);
}
public function boot(IBootContext $context): void {
diff --git a/apps/comments/lib/Search/Provider.php b/apps/comments/lib/Search/CommentsSearchProvider.php
index 2f3575d9c84..3d503cf5c51 100644
--- a/apps/comments/lib/Search/Provider.php
+++ b/apps/comments/lib/Search/CommentsSearchProvider.php
@@ -32,10 +32,11 @@ use OCP\IUserManager;
use OCP\Search\IProvider;
use OCP\Search\ISearchQuery;
use OCP\Search\SearchResult;
+use OCP\Search\SearchResultEntry;
use function array_map;
use function pathinfo;
-class Provider implements IProvider {
+class CommentsSearchProvider implements IProvider {
/** @var IUserManager */
private $userManager;
@@ -59,14 +60,30 @@ class Provider implements IProvider {
$this->legacyProvider = $legacyProvider;
}
+ /**
+ * @inheritDoc
+ */
public function getId(): string {
return 'comments';
}
+ /**
+ * @inheritDoc
+ */
public function getName(): string {
return $this->l10n->t('Comments');
}
+ /**
+ * @inheritDoc
+ */
+ public function getOrder(): int {
+ return 10;
+ }
+
+ /**
+ * @inheritDoc
+ */
public function search(IUser $user, ISearchQuery $query): SearchResult {
return SearchResult::complete(
$this->l10n->t('Comments'),
@@ -77,7 +94,7 @@ class Provider implements IProvider {
$avatarUrl = $isUser
? $this->urlGenerator->linkToRoute('core.avatar.getAvatar', ['userId' => $result->authorId, 'size' => 42])
: $this->urlGenerator->linkToRoute('core.GuestAvatar.getAvatar', ['guestName' => $result->authorId, 'size' => 42]);
- return new CommentsSearchResultEntry(
+ return new SearchResultEntry(
$avatarUrl,
$result->name,
$path,
diff --git a/apps/comments/lib/Search/CommentsSearchResultEntry.php b/apps/comments/lib/Search/CommentsSearchResultEntry.php
deleted file mode 100644
index de24cf9cc52..00000000000
--- a/apps/comments/lib/Search/CommentsSearchResultEntry.php
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/**
- * @copyright 2020 Christoph Wurst <christoph@winzerhof-wurst.at>
- *
- * @author 2020 Christoph Wurst <christoph@winzerhof-wurst.at>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-namespace OCA\Comments\Search;
-
-use OCP\Search\ASearchResultEntry;
-
-class CommentsSearchResultEntry extends ASearchResultEntry {
-}