diff options
author | Daniel Teichmann <daniel.teichmann@das-netzwerkteam.de> | 2022-02-24 14:17:43 +0100 |
---|---|---|
committer | Daniel Teichmann <daniel.teichmann@das-netzwerkteam.de> | 2022-03-21 13:02:46 +0100 |
commit | 73a7ced1fd8cb5c7a0ee74a15890800742d1e455 (patch) | |
tree | a292d5929a0f32a187bd048d756a21fe1cc99434 /apps/dav/lib/CalDAV | |
parent | 84ae0703a3b74c5ce616c7ca690fedebd3a0d3ab (diff) | |
download | nextcloud-server-73a7ced1fd8cb5c7a0ee74a15890800742d1e455.tar.gz nextcloud-server-73a7ced1fd8cb5c7a0ee74a15890800742d1e455.zip |
Fix #31303: Make reminder notification behaviour selectable.
Signed-off-by: Daniel Teichmann <daniel.teichmann@das-netzwerkteam.de>
Diffstat (limited to 'apps/dav/lib/CalDAV')
-rw-r--r-- | apps/dav/lib/CalDAV/Reminder/ReminderService.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/apps/dav/lib/CalDAV/Reminder/ReminderService.php b/apps/dav/lib/CalDAV/Reminder/ReminderService.php index 109fc95e9be..d6901cc4fb0 100644 --- a/apps/dav/lib/CalDAV/Reminder/ReminderService.php +++ b/apps/dav/lib/CalDAV/Reminder/ReminderService.php @@ -33,6 +33,7 @@ namespace OCA\DAV\CalDAV\Reminder; use DateTimeImmutable; use OCA\DAV\CalDAV\CalDavBackend; use OCP\AppFramework\Utility\ITimeFactory; +use OCP\IConfig; use OCP\IGroup; use OCP\IGroupManager; use OCP\IUser; @@ -66,6 +67,9 @@ class ReminderService { /** @var ITimeFactory */ private $timeFactory; + /** @var IConfig */ + private $config; + public const REMINDER_TYPE_EMAIL = 'EMAIL'; public const REMINDER_TYPE_DISPLAY = 'DISPLAY'; public const REMINDER_TYPE_AUDIO = 'AUDIO'; @@ -90,19 +94,22 @@ class ReminderService { * @param IGroupManager $groupManager * @param CalDavBackend $caldavBackend * @param ITimeFactory $timeFactory + * @param IConfig $config */ public function __construct(Backend $backend, NotificationProviderManager $notificationProviderManager, IUserManager $userManager, IGroupManager $groupManager, CalDavBackend $caldavBackend, - ITimeFactory $timeFactory) { + ITimeFactory $timeFactory, + IConfig $config) { $this->backend = $backend; $this->notificationProviderManager = $notificationProviderManager; $this->userManager = $userManager; $this->groupManager = $groupManager; $this->caldavBackend = $caldavBackend; $this->timeFactory = $timeFactory; + $this->config = $config; } /** @@ -145,7 +152,12 @@ class ReminderService { continue; } - $users = $this->getAllUsersWithWriteAccessToCalendar($reminder['calendar_id']); + if ($this->config->getAppValue('dav', 'sendEventRemindersToSharedGroupMembers', 'yes') === 'no') { + $users = $this->getAllUsersWithWriteAccessToCalendar($reminder['calendar_id']); + } else { + $users = []; + } + $user = $this->getUserFromPrincipalURI($reminder['principaluri']); if ($user) { $users[] = $user; |