aboutsummaryrefslogtreecommitdiffstats
path: root/core/Controller/AutoCompleteController.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-10-31 15:07:02 +0100
committerJoas Schilling <coding@schilljs.com>2023-11-02 11:08:53 +0100
commit2b8114d59df031b557b37daa090822931ec60301 (patch)
tree3768ac7b8392acbd7f31d7acb050261b32044d0b /core/Controller/AutoCompleteController.php
parentd779092564297da2286631cb0dd381e585e635ee (diff)
downloadnextcloud-server-2b8114d59df031b557b37daa090822931ec60301.tar.gz
nextcloud-server-2b8114d59df031b557b37daa090822931ec60301.zip
feat(events): Add typed event for filtering autocompletion suggestions
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'core/Controller/AutoCompleteController.php')
-rw-r--r--core/Controller/AutoCompleteController.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/core/Controller/AutoCompleteController.php b/core/Controller/AutoCompleteController.php
index 0b692d85277..c873603fd0e 100644
--- a/core/Controller/AutoCompleteController.php
+++ b/core/Controller/AutoCompleteController.php
@@ -35,6 +35,7 @@ use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\OCSController;
use OCP\Collaboration\AutoComplete\AutoCompleteEvent;
+use OCP\Collaboration\AutoComplete\AutoCompleteFilterEvent;
use OCP\Collaboration\AutoComplete\IManager;
use OCP\Collaboration\Collaborators\ISearch;
use OCP\EventDispatcher\IEventDispatcher;
@@ -88,6 +89,18 @@ class AutoCompleteController extends OCSController {
$this->dispatcher->dispatch(IManager::class . '::filterResults', $event);
$results = $event->getResults();
+ $event = new AutoCompleteFilterEvent(
+ $results,
+ $search,
+ $itemType,
+ $itemId,
+ $sorter,
+ $shareTypes,
+ $limit,
+ );
+ $this->dispatcher->dispatchTyped($event);
+ $results = $event->getResults();
+
$exactMatches = $results['exact'];
unset($results['exact']);
$results = array_merge_recursive($exactMatches, $results);