diff options
author | Richard Steinmetz <richard@steinmetz.cloud> | 2022-11-01 15:49:54 +0100 |
---|---|---|
committer | Richard Steinmetz <richard@steinmetz.cloud> | 2022-11-04 16:24:57 +0100 |
commit | 304b71647f6aad9d6fc0caa775c3c91ba1724269 (patch) | |
tree | 68f8220b173fa1a0beeec79758b8439868344e37 /apps/dav/lib/CalDAV/Schedule | |
parent | f53abd3995cffcc0c0a3c5d9be80d993242d9b4e (diff) | |
download | nextcloud-server-304b71647f6aad9d6fc0caa775c3c91ba1724269.tar.gz nextcloud-server-304b71647f6aad9d6fc0caa775c3c91ba1724269.zip |
Fix duplicate event email notifications
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
Diffstat (limited to 'apps/dav/lib/CalDAV/Schedule')
-rw-r--r-- | apps/dav/lib/CalDAV/Schedule/Plugin.php | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/apps/dav/lib/CalDAV/Schedule/Plugin.php b/apps/dav/lib/CalDAV/Schedule/Plugin.php index 44517541faa..ed160cac2c2 100644 --- a/apps/dav/lib/CalDAV/Schedule/Plugin.php +++ b/apps/dav/lib/CalDAV/Schedule/Plugin.php @@ -9,6 +9,7 @@ * @author Joas Schilling <coding@schilljs.com> * @author Roeland Jago Douma <roeland@famdouma.nl> * @author Thomas Citharel <nextcloud@tcit.fr> + * @author Richard Steinmetz <richard@steinmetz.cloud> * * @license GNU AGPL version 3 or any later version * @@ -46,6 +47,7 @@ use Sabre\VObject\Component; use Sabre\VObject\Component\VCalendar; use Sabre\VObject\Component\VEvent; use Sabre\VObject\DateTimeParser; +use Sabre\VObject\Document; use Sabre\VObject\FreeBusyGenerator; use Sabre\VObject\ITip; use Sabre\VObject\Parameter; @@ -164,6 +166,14 @@ class Plugin extends \Sabre\CalDAV\Schedule\Plugin { * @inheritDoc */ public function scheduleLocalDelivery(ITip\Message $iTipMessage):void { + /** @var Component|null $vevent */ + $vevent = $iTipMessage->message->VEVENT ?? null; + + // Strip VALARMs from incoming VEVENT + if ($vevent && isset($vevent->VALARM)) { + $vevent->remove('VALARM'); + } + parent::scheduleLocalDelivery($iTipMessage); // We only care when the message was successfully delivered locally @@ -200,18 +210,10 @@ class Plugin extends \Sabre\CalDAV\Schedule\Plugin { return; } - if (!isset($iTipMessage->message)) { + if (!$vevent) { return; } - $vcalendar = $iTipMessage->message; - if (!isset($vcalendar->VEVENT)) { - return; - } - - /** @var Component $vevent */ - $vevent = $vcalendar->VEVENT; - // We don't support autoresponses for recurrencing events for now if (isset($vevent->RRULE) || isset($vevent->RDATE)) { return; |