Skip to content

Commit

Permalink
Refactor OC\Server::getContactsManager
Browse files Browse the repository at this point in the history
  • Loading branch information
summersab committed Aug 29, 2023
1 parent 613cd16 commit 507bc6e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/private/Share/Share.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
namespace OC\Share;

use OCA\Files_Sharing\ShareBackend\File;
use OCP\Contacts\IManager as IContactsManager;
use OCP\DB\Exception;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\IDBConnection;
Expand Down Expand Up @@ -596,7 +597,7 @@ public static function getItems($itemType, ?string $item = null, ?int $shareType
$row['share_with_displayname'] = $shareWithUser === null ? $row['share_with'] : $shareWithUser->getDisplayName();
} elseif (isset($row['share_with']) && $row['share_with'] != '' &&
$row['share_type'] === IShare::TYPE_REMOTE) {
$addressBookEntries = \OC::$server->getContactsManager()->search($row['share_with'], ['CLOUD'], [
$addressBookEntries = \OC::$server->get(IContactsManager::class)->search($row['share_with'], ['CLOUD'], [
'limit' => 1,
'enumeration' => false,
'fullmatch' => false,
Expand Down
2 changes: 1 addition & 1 deletion lib/public/Contacts/IManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ interface IManager {
* Following function shows how to search for contacts for the name and the email address.
*
* public static function getMatchingRecipient($term) {
* $cm = \OC::$server->getContactsManager();
* $cm = \OC::$server->get(\OCP\Contacts\IManager::class);
* // The API is not active -> nothing to do
* if (!$cm->isEnabled()) {
* return array();
Expand Down

0 comments on commit 507bc6e

Please sign in to comment.