summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2021-06-01 08:06:15 +0200
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2021-06-01 08:19:57 +0200
commitb3ae06f3719d9efac97932ee6919f282980c2b03 (patch)
treee4eb2b3fb2328e23dd11703885920f85e3a64eb0 /lib
parentfec1798301f0dbe6986c775e4596b07ce27145d9 (diff)
Fix tests
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/ContactsMenu/Providers/DetailsProvider.php32
1 files changed, 11 insertions, 21 deletions
diff --git a/lib/ContactsMenu/Providers/DetailsProvider.php b/lib/ContactsMenu/Providers/DetailsProvider.php
index cb8ac217..de4fdbdd 100644
--- a/lib/ContactsMenu/Providers/DetailsProvider.php
+++ b/lib/ContactsMenu/Providers/DetailsProvider.php
@@ -28,7 +28,6 @@ use OCP\Contacts\ContactsMenu\IActionFactory;
use OCP\Contacts\ContactsMenu\IEntry;
use OCP\Contacts\ContactsMenu\IProvider;
use OCP\Contacts\IManager;
-use OCP\IConfig;
use OCP\IL10N;
use OCP\IURLGenerator;
@@ -46,9 +45,6 @@ class DetailsProvider implements IProvider {
/** @var IManager */
private $manager;
- /** @var IConfig */
- private $config;
-
/**
* @param IURLGenerator $urlGenerator
* @param IActionFactory $actionFactory
@@ -56,13 +52,11 @@ class DetailsProvider implements IProvider {
public function __construct(IURLGenerator $urlGenerator,
IActionFactory $actionFactory,
IL10N $l10n,
- IManager $manager,
- IConfig $config) {
+ IManager $manager) {
$this->actionFactory = $actionFactory;
$this->urlGenerator = $urlGenerator;
$this->l10n = $l10n;
$this->manager = $manager;
- $this->config = $config;
}
/**
@@ -111,22 +105,18 @@ class DetailsProvider implements IProvider {
return;
}
- // We need $this->manager->getAddressbooksUris() to add this function
- $ncVersion = $this->config->getSystemValue('version', '0.0.0');
- if (version_compare($ncVersion, '16.0.0', '>=')) {
- $addressBookUri = $this->getAddressBookUri($entry->getProperty('addressbook-key'));
+ $addressBookUri = $this->getAddressBookUri($entry->getProperty('addressbook-key'));
- $iconUrl = $this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'actions/info.svg'));
+ $iconUrl = $this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'actions/info.svg'));
- $contactsUrl = $this->urlGenerator->getAbsoluteURL(
- $this->urlGenerator->linkToRoute('contacts.contacts.direct', [
- 'contact' => $uid . '~' . $addressBookUri
- ])
- );
+ $contactsUrl = $this->urlGenerator->getAbsoluteURL(
+ $this->urlGenerator->linkToRoute('contacts.contacts.direct', [
+ 'contact' => $uid . '~' . $addressBookUri
+ ])
+ );
- $action = $this->actionFactory->newLinkAction($iconUrl, $this->l10n->t('Details'), $contactsUrl);
- $action->setPriority(0);
- $entry->addAction($action);
- }
+ $action = $this->actionFactory->newLinkAction($iconUrl, $this->l10n->t('Details'), $contactsUrl);
+ $action->setPriority(0);
+ $entry->addAction($action);
}
}