diff --git a/.patches/custom-itip-broker.diff b/.patches/custom-itip-broker.diff new file mode 100644 index 000000000..13c835816 --- /dev/null +++ b/.patches/custom-itip-broker.diff @@ -0,0 +1,52 @@ +diff --git a/lib/CalDAV/Schedule/Plugin.php b/lib/CalDAV/Schedule/Plugin.php +index 5e56596101..5bca56d47e 100644 +--- a/lib/CalDAV/Schedule/Plugin.php ++++ b/lib/CalDAV/Schedule/Plugin.php +@@ -25,6 +25,7 @@ + use Sabre\VObject; + use Sabre\VObject\Component\VCalendar; + use Sabre\VObject\ITip; ++use Sabre\VObject\ITip\Broker; + use Sabre\VObject\ITip\Message; + use Sabre\VObject\Reader; + +@@ -389,7 +390,7 @@ public function beforeUnbind($path) + $node->getOwner() + ); + +- $broker = new ITip\Broker(); ++ $broker = $this->createITipBroker(); + $messages = $broker->parseEvent(null, $addresses, $node->get()); + + foreach ($messages as $message) { +@@ -500,7 +501,7 @@ public function scheduleLocalDelivery(ITip\Message $iTipMessage) + $isNewNode = true; + } + +- $broker = new ITip\Broker(); ++ $broker = $this->createITipBroker(); + $newObject = $broker->processMessage($iTipMessage, $currentObject); + + $inbox->createFile($newFileName, $iTipMessage->message->serialize()); +@@ -611,7 +612,7 @@ public function getSupportedPrivilegeSet(INode $node, array &$supportedPrivilege + */ + protected function processICalendarChange($oldObject, VCalendar $newObject, array $addresses, array $ignore = [], &$modified = false) + { +- $broker = new ITip\Broker(); ++ $broker = $this->createITipBroker(); + $messages = $broker->parseEvent($newObject, $addresses, $oldObject); + + if ($messages) { +@@ -994,4 +995,12 @@ public function getPluginInfo() + 'link' => 'http://sabre.io/dav/scheduling/', + ]; + } ++ ++ /** ++ * Returns an instance of the iTip\Broker. ++ */ ++ protected function createITipBroker(): Broker ++ { ++ return new Broker(); ++ } + } diff --git a/composer.patches.json b/composer.patches.json index 96a4fa1ea..b86d16fd9 100644 --- a/composer.patches.json +++ b/composer.patches.json @@ -1,6 +1,7 @@ { "patches": { "sabre/dav": { + "Allow for custom iTip broker": ".patches/custom-itip-broker.diff", "Fix getNodeForPath cache": ".patches/fix-cache-for-node.diff" }, "wapmorgan/mp3info": { diff --git a/composer/installed.json b/composer/installed.json index e6037460c..aa2a55b28 100644 --- a/composer/installed.json +++ b/composer/installed.json @@ -3948,6 +3948,7 @@ "type": "library", "extra": { "patches_applied": { + "Allow for custom iTip broker": ".patches/custom-itip-broker.diff", "Fix getNodeForPath cache": ".patches/fix-cache-for-node.diff" } }, diff --git a/sabre/dav/PATCHES.txt b/sabre/dav/PATCHES.txt index 9e202eda2..101f21ee6 100644 --- a/sabre/dav/PATCHES.txt +++ b/sabre/dav/PATCHES.txt @@ -1,6 +1,10 @@ This file was automatically generated by Composer Patches (https://github.com/cweagans/composer-patches) Patches applied to this directory: +Allow for custom iTip broker +Source: .patches/custom-itip-broker.diff + + Fix getNodeForPath cache Source: .patches/fix-cache-for-node.diff diff --git a/sabre/dav/lib/CalDAV/Schedule/Plugin.php b/sabre/dav/lib/CalDAV/Schedule/Plugin.php index 5e5659610..5bca56d47 100644 --- a/sabre/dav/lib/CalDAV/Schedule/Plugin.php +++ b/sabre/dav/lib/CalDAV/Schedule/Plugin.php @@ -25,6 +25,7 @@ use Sabre\VObject; use Sabre\VObject\Component\VCalendar; use Sabre\VObject\ITip; +use Sabre\VObject\ITip\Broker; use Sabre\VObject\ITip\Message; use Sabre\VObject\Reader; @@ -389,7 +390,7 @@ public function beforeUnbind($path) $node->getOwner() ); - $broker = new ITip\Broker(); + $broker = $this->createITipBroker(); $messages = $broker->parseEvent(null, $addresses, $node->get()); foreach ($messages as $message) { @@ -500,7 +501,7 @@ public function scheduleLocalDelivery(ITip\Message $iTipMessage) $isNewNode = true; } - $broker = new ITip\Broker(); + $broker = $this->createITipBroker(); $newObject = $broker->processMessage($iTipMessage, $currentObject); $inbox->createFile($newFileName, $iTipMessage->message->serialize()); @@ -611,7 +612,7 @@ public function getSupportedPrivilegeSet(INode $node, array &$supportedPrivilege */ protected function processICalendarChange($oldObject, VCalendar $newObject, array $addresses, array $ignore = [], &$modified = false) { - $broker = new ITip\Broker(); + $broker = $this->createITipBroker(); $messages = $broker->parseEvent($newObject, $addresses, $oldObject); if ($messages) { @@ -994,4 +995,12 @@ public function getPluginInfo() 'link' => 'http://sabre.io/dav/scheduling/', ]; } + + /** + * Returns an instance of the iTip\Broker. + */ + protected function createITipBroker(): Broker + { + return new Broker(); + } }