Autocomplete: trigger "contacts_autocomplete_after" hook processing

Provide existing list of contact suggestions as an argument - it might be unclear
now what logic plugin developers decide to implement, but data for that logic
should be provided upfront, and that includes list of suggestions that RC
itself comes up with.

Plugin logic might then replace the list entirely, or just rearrange its entries, or use
part of the list when it runs out of own ideas, or do something entirely different.
pull/5203/head
Bostjan Skufca 8 years ago
parent 865230e420
commit ed55af4aa9

@ -175,5 +175,14 @@ if (!empty($book_types) && strlen($search)) {
}
}
// Allow autocomplete result optimization via plugin
$pluginResult = $RCMAIL->plugins->exec_hook('contacts_autocomplete_after', array(
'search' => $search,
'contacts' => $contacts, // Provide already-found contacts to plugin if they are required
));
$contacts = $pluginResult['contacts'];
$OUTPUT->command('ksearch_query_results', $contacts, $search, $reqid);
$OUTPUT->send();

Loading…
Cancel
Save