diff --git a/lib/CalDAV/Schedule/Plugin.php b/lib/CalDAV/Schedule/Plugin.php index 5e56596101..9272e1e555 100644 --- a/lib/CalDAV/Schedule/Plugin.php +++ b/lib/CalDAV/Schedule/Plugin.php @@ -389,7 +389,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 +500,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 +611,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 +994,14 @@ public function getPluginInfo() 'link' => 'http://sabre.io/dav/scheduling/', ]; } + + /** + * Returns an instance of the iTip\Broker + * + * @return Broker + */ + protected function createITipBroker() + { + return new ITip\Broker(); + } }