Skip to content

Commit

Permalink
Allow for custom iTipBroker
Browse files Browse the repository at this point in the history
Signed-off-by: SebastianKrupinski <[email protected]>
  • Loading branch information
SebastianKrupinski committed Aug 21, 2024
1 parent fd570dc commit a38eb81
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions lib/CalDAV/Schedule/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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();
}
}

0 comments on commit a38eb81

Please sign in to comment.