summaryrefslogtreecommitdiffstats
path: root/apps/twofactor_backupcodes/lib/Activity/Provider.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/twofactor_backupcodes/lib/Activity/Provider.php')
-rw-r--r--apps/twofactor_backupcodes/lib/Activity/Provider.php19
1 files changed, 12 insertions, 7 deletions
diff --git a/apps/twofactor_backupcodes/lib/Activity/Provider.php b/apps/twofactor_backupcodes/lib/Activity/Provider.php
index 9c7aaeae630..739ac9bbe13 100644
--- a/apps/twofactor_backupcodes/lib/Activity/Provider.php
+++ b/apps/twofactor_backupcodes/lib/Activity/Provider.php
@@ -24,8 +24,8 @@ namespace OCA\TwoFactorBackupCodes\Activity;
use InvalidArgumentException;
use OCP\Activity\IEvent;
+use OCP\Activity\IManager;
use OCP\Activity\IProvider;
-use OCP\ILogger;
use OCP\IURLGenerator;
use OCP\L10N\IFactory as L10nFactory;
@@ -37,17 +37,17 @@ class Provider implements IProvider {
/** @var IURLGenerator */
private $urlGenerator;
- /** @var ILogger */
- private $logger;
+ /** @var IManager */
+ private $activityManager;
/**
* @param L10nFactory $l10n
* @param IURLGenerator $urlGenerator
- * @param ILogger $logger
+ * @param IManager $activityManager
*/
- public function __construct(L10nFactory $l10n, IURLGenerator $urlGenerator, ILogger $logger) {
- $this->logger = $logger;
+ public function __construct(L10nFactory $l10n, IURLGenerator $urlGenerator, IManager $activityManager) {
$this->urlGenerator = $urlGenerator;
+ $this->activityManager = $activityManager;
$this->l10n = $l10n;
}
@@ -61,7 +61,12 @@ class Provider implements IProvider {
switch ($event->getSubject()) {
case 'codes_generated':
$event->setParsedSubject($l->t('You created two-factor backup codes for your account'));
- $event->setIcon($this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'actions/password.svg')));
+
+ if ($this->activityManager->getRequirePNG()) {
+ $event->setIcon($this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'actions/password.png')));
+ } else {
+ $event->setIcon($this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'actions/password.svg')));
+ }
break;
default:
throw new InvalidArgumentException();