Add check to unregister system addressbook

Signed-off-by: Akhil <akhil.potukuchi@gmail.com>
This commit is contained in:
Akhil 2023-01-27 01:32:00 +05:30
parent 3b43a8bc78
commit 6dff9cd781
No known key found for this signature in database
GPG key ID: 7C737B3BD58C0A26

View file

@ -21,6 +21,12 @@ class NextcloudContactsSuggestions implements \RainLoop\Providers\Suggestions\IS
return [];
}
// Unregister system addressbook so as to return only contacts in user's addressbooks
foreach($cm->getUserAddressBooks() as $addressBook) {
if($addressBook->isSystemAddressBook()) {
$cm->unregisterAddressBook($addressBook);
}
}
$aSearchResult = $cm->search($sQuery, array('FN', 'NICKNAME', 'TITLE', 'EMAIL'));
//$this->oLogger->WriteDump($aSearchResult);