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

github.com/nextcloud/documentation.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2022-11-09 16:23:42 +0300
committerJoas Schilling <coding@schilljs.com>2022-11-09 16:24:41 +0300
commit8576c831af884ddd590d62133c4c62e67c6d3a02 (patch)
treeaf1bf0e1bcf929c3264f1d9e21e3fc236ebf0ead
parent56641f0fe17757f106ced1e4a86c1870535d74f9 (diff)
Document the AutoCompleteEvent event
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r--developer_manual/client_apis/OCS/ocs-api-overview.rst17
1 files changed, 13 insertions, 4 deletions
diff --git a/developer_manual/client_apis/OCS/ocs-api-overview.rst b/developer_manual/client_apis/OCS/ocs-api-overview.rst
index e8341ccdd..79adfccef 100644
--- a/developer_manual/client_apis/OCS/ocs-api-overview.rst
+++ b/developer_manual/client_apis/OCS/ocs-api-overview.rst
@@ -218,12 +218,21 @@ An example curl command would be:
curl -i -u master -X GET -H "OCS-APIRequest: true" 'https://my.nextcloud/ocs/v2.php/core/autocomplete/get?search=JOANNE%40EMAIL.ISP&itemType=%20&itemId=%20&shareTypes[]=8&limit=2'
-That would look for JOANNE@EMAIL.ISP as guest user. Maximum 2 results to be returned for a regular user, the shareTypes array would carry only "0".
-``itemType`` and ``itemId`` are left (set to a white space), essentially they are to give context about the use case, so sorters can do their work (like who
-commented last). It can be an option for filtering on a later stage but you can also leave them out as per the below example.
+That would look for JOANNE@EMAIL.ISP as guest user. Maximum 2 results to be returned for a regular user, the
+shareTypes array would carry only "8". ``itemType`` and ``itemId`` are left out (set to a white space),
+essentially they are to give context about the use case, so sorters can do their work (like who commented last).
+It can be an option for filtering on a later stage but you can also leave them out as per the below example.
.. code::
curl -i -u master -X GET -H "OCS-APIRequest: true" 'https://my.nextcloud/ocs/v2.php/core/autocomplete/get?search=JOANNE%40EMAIL.ISP&shareTypes[]=8&limit=2'
-The shareType would default to regular users if you left it out), the limit defaults to 10.
+The shareType defaults to regular users if you left it out), the limit defaults to 10.
+
+Filtering the auto-complete results
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+In case needed, you can also further filter the auto-complete results on the PHP side using the
+``OCP\Collaboration\AutoComplete\AutoCompleteEvent`` event. The event gives you access to the current
+result set, the item and share types and some more information that you can use to e.g. limit the autocomplete
+results to users that are actually in the current chat conversation.