Sync global-autoresponder current state

This commit is contained in:
Marek Miklewicz
2026-07-04 15:16:50 +02:00
parent 196ee224fe
commit af775ce976
47 changed files with 1165 additions and 1037 deletions
+1 -4
View File
@@ -114,7 +114,7 @@ class DirectAdminVacationApi
return [$m[1], $m[2]];
}
if (!preg_match('/^([0-9]{4}-[0-9]{2}-[0-9]{2})\|(morning|afternoon|evening)$/', $value, $m)) {
throw new InvalidArgumentException('DirectAdmin API backend requires exact date-time values');
throw new InvalidArgumentException('DirectAdmin vacation sync requires exact date-time values');
}
$time = ['morning' => '08:00', 'afternoon' => '13:00', 'evening' => $start ? '18:00' : '23:59'][$m[2]];
return [$m[1], $time];
@@ -147,9 +147,6 @@ class DirectAdminVacationApi
/** @param array<string,mixed> $rule */
private function replyOnceTime(array $rule): string
{
if (!empty($rule['reply_every_message'])) {
return '1m';
}
return match ((int)($rule['repeat_minutes'] ?? 1440)) {
1 => '1m',
10 => '10m',