Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/mail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Steinmetz <richard@steinmetz.cloud>2022-04-26 19:25:22 +0300
committerAnna Larch <anna@nextcloud.com>2022-04-28 19:05:31 +0300
commit738dde801849b1271870a846bcf5dde35dc7034b (patch)
treee184d2161170de843f6c1c7d6afd982110368ec4 /lib/Controller
parent27fe2975aac226aad344d7a54b0858d136565d91 (diff)
Disable scheduled sending if ajax cron is used
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
Diffstat (limited to 'lib/Controller')
-rw-r--r--lib/Controller/PageController.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php
index 332a91bca..4a02c246c 100644
--- a/lib/Controller/PageController.php
+++ b/lib/Controller/PageController.php
@@ -181,6 +181,13 @@ class PageController extends Controller {
$this->outboxService->getMessages($user->getUID())
);
+ // Disable scheduled send in frontend if ajax cron is used because it is unreliable
+ $cronMode = $this->config->getAppValue('core', 'backgroundjobs_mode', 'ajax');
+ $this->initialStateService->provideInitialState(
+ 'disable-scheduled-send',
+ $cronMode === 'ajax',
+ );
+
$csp = new ContentSecurityPolicy();
$csp->addAllowedFrameDomain('\'self\'');
$response->setContentSecurityPolicy($csp);