summaryrefslogtreecommitdiffstats
path: root/apps/twofactor_backupcodes/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-07-07 11:05:00 +0200
committerGitHub <noreply@github.com>2017-07-07 11:05:00 +0200
commitb4deba207856e92adfbf7239ea7d2420157993dd (patch)
tree22bc71158a91e74e1d28c639c0801a735a78db76 /apps/twofactor_backupcodes/lib
parentb1520a645833c2047103a2cf550f5c21b1c25586 (diff)
parentca3a6ec6077e4248d56550b1acb19ab72546e808 (diff)
downloadnextcloud-server-b4deba207856e92adfbf7239ea7d2420157993dd.tar.gz
nextcloud-server-b4deba207856e92adfbf7239ea7d2420157993dd.zip
Merge pull request #5483 from nextcloud/issue-5075-png-files-for-activity-emails
Use PNGs for icons in activity emails
Diffstat (limited to 'apps/twofactor_backupcodes/lib')
-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();