diff options
author | Anna Larch <anna@nextcloud.com> | 2021-06-23 14:03:52 +0300 |
---|---|---|
committer | Anna Larch <anna@nextcloud.com> | 2021-08-24 13:41:14 +0300 |
commit | 2422e15270ab69b1da62f01231018c078738a66d (patch) | |
tree | 65bb81dd0153972c48f740dfb72f65e07b179872 /lib/Settings | |
parent | 251d6f0d23a3dcaa41daaf84d12fd10a85095515 (diff) |
Create anti spam report feature
Signed-off-by: Anna Larch <anna@nextcloud.com>
Diffstat (limited to 'lib/Settings')
-rw-r--r-- | lib/Settings/AdminSettings.php | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/Settings/AdminSettings.php b/lib/Settings/AdminSettings.php index 428201244..2bb715200 100644 --- a/lib/Settings/AdminSettings.php +++ b/lib/Settings/AdminSettings.php @@ -26,6 +26,7 @@ declare(strict_types=1); namespace OCA\Mail\Settings; use OCA\Mail\AppInfo\Application; +use OCA\Mail\Service\AntiSpamService; use OCA\Mail\Service\Provisioning\Manager as ProvisioningManager; use OCP\AppFramework\Http\TemplateResponse; use OCP\IInitialStateService; @@ -40,10 +41,15 @@ class AdminSettings implements ISettings { /** @var ProvisioningManager */ private $provisioningManager; + /** @var AntiSpamService */ + private $antiSpamService; + public function __construct(IInitialStateService $initialStateService, - ProvisioningManager $provisioningManager) { + ProvisioningManager $provisioningManager, + AntiSpamService $antiSpamService) { $this->initialStateService = $initialStateService; $this->provisioningManager = $provisioningManager; + $this->antiSpamService = $antiSpamService; } public function getForm() { @@ -53,6 +59,16 @@ class AdminSettings implements ISettings { $this->provisioningManager->getConfigs() ); + $this->initialStateService->provideInitialState( + Application::APP_ID, + 'antispam_setting', + [ + 'spam' => $this->antiSpamService->getSpamEmail(), + 'ham' => $this->antiSpamService->getHamEmail(), + ] + ); + + $this->initialStateService->provideLazyInitialState( Application::APP_ID, 'ldap_aliases_integration', |