diff options
author | Joas Schilling <coding@schilljs.com> | 2023-10-31 15:07:02 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2023-11-02 11:08:53 +0100 |
commit | 2b8114d59df031b557b37daa090822931ec60301 (patch) | |
tree | 3768ac7b8392acbd7f31d7acb050261b32044d0b /core/Controller/AutoCompleteController.php | |
parent | d779092564297da2286631cb0dd381e585e635ee (diff) | |
download | nextcloud-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.php | 13 |
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); |