aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Contacts/ContactsMenu/Providers/ProfileProvider.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Contacts/ContactsMenu/Providers/ProfileProvider.php')
-rw-r--r--lib/private/Contacts/ContactsMenu/Providers/ProfileProvider.php18
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/private/Contacts/ContactsMenu/Providers/ProfileProvider.php b/lib/private/Contacts/ContactsMenu/Providers/ProfileProvider.php
index 15d24fc7773..e654319c3fa 100644
--- a/lib/private/Contacts/ContactsMenu/Providers/ProfileProvider.php
+++ b/lib/private/Contacts/ContactsMenu/Providers/ProfileProvider.php
@@ -24,7 +24,7 @@
namespace OC\Contacts\ContactsMenu\Providers;
-use OCP\Accounts\IAccountManager;
+use OC\Profile\ProfileManager;
use OCP\Contacts\ContactsMenu\IActionFactory;
use OCP\Contacts\ContactsMenu\IEntry;
use OCP\Contacts\ContactsMenu\IProvider;
@@ -33,14 +33,13 @@ use OCP\IUserManager;
use OCP\L10N\IFactory as IL10NFactory;
class ProfileProvider implements IProvider {
- use \OC\Profile\TProfileHelper;
-
- /** @var IAccountManager */
- private $accountManager;
/** @var IActionFactory */
private $actionFactory;
+ /** @var ProfileManager */
+ private $profileManager;
+
/** @var IL10NFactory */
private $l10nFactory;
@@ -51,21 +50,21 @@ class ProfileProvider implements IProvider {
private $userManager;
/**
- * @param IAccountManager $accountManager
* @param IActionFactory $actionFactory
+ * @param ProfileManager $profileManager
* @param IL10NFactory $l10nFactory
* @param IURLGenerator $urlGenerator
* @param IUserManager $userManager
*/
public function __construct(
- IAccountManager $accountManager,
IActionFactory $actionFactory,
+ ProfileManager $profileManager,
IL10NFactory $l10nFactory,
IURLGenerator $urlGenerator,
IUserManager $userManager
) {
- $this->accountManager = $accountManager;
$this->actionFactory = $actionFactory;
+ $this->profileManager = $profileManager;
$this->l10nFactory = $l10nFactory;
$this->urlGenerator = $urlGenerator;
$this->userManager = $userManager;
@@ -78,8 +77,7 @@ class ProfileProvider implements IProvider {
$targetUserId = $entry->getProperty('UID');
$targetUser = $this->userManager->get($targetUserId);
if (!empty($targetUser)) {
- $account = $this->accountManager->getAccount($targetUser);
- if ($this->isProfileEnabled($account)) {
+ if ($this->profileManager->isProfileEnabled($targetUser)) {
$iconUrl = $this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'actions/profile.svg'));
$profileActionText = $this->l10nFactory->get('lib')->t('View profile');
$profileUrl = $this->urlGenerator->linkToRouteAbsolute('core.ProfilePage.index', ['targetUserId' => $targetUserId]);