Skip to content

Commit

Permalink
make it possible to opt out of our iMip Plugin
Browse files Browse the repository at this point in the history
Signed-off-by: Georg Ehrke <[email protected]>
  • Loading branch information
georgehrke committed Jun 8, 2017
1 parent b8c62a7 commit 6d74321
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
6 changes: 5 additions & 1 deletion apps/dav/appinfo/v1/caldav.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
$calDavBackend = new CalDavBackend($db, $principalBackend, $userManager, $random, $dispatcher, true);

$debugging = \OC::$server->getConfig()->getSystemValue('debug', false);
$sendInvitations = \OC::$server->getConfig()->getSystemValue('caldav_send_invitations', true);

// Root nodes
$principalCollection = new \Sabre\CalDAV\Principal\Collection($principalBackend);
Expand Down Expand Up @@ -84,7 +85,10 @@
$server->addPlugin(new \Sabre\DAV\Sync\Plugin());
$server->addPlugin(new \Sabre\CalDAV\ICSExportPlugin());
$server->addPlugin(new \OCA\DAV\CalDAV\Schedule\Plugin());
$server->addPlugin(new \OCA\DAV\CalDAV\Schedule\IMipPlugin( \OC::$server->getMailer(), \OC::$server->getLogger(), new \OC\AppFramework\Utility\TimeFactory()));
if ($sendInvitations) {
$server->addPlugin(new \OCA\DAV\CalDAV\Schedule\IMipPlugin(\OC::$server->getMailer(),
\OC::$server->getLogger(), new \OC\AppFramework\Utility\TimeFactory()));
}
$server->addPlugin(new ExceptionLoggerPlugin('caldav', \OC::$server->getLogger()));

// And off we go!
Expand Down
4 changes: 3 additions & 1 deletion apps/dav/lib/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ public function __construct(IRequest $request, $baseUri) {
$this->server->addPlugin(new \OCA\DAV\CalDAV\Plugin());
$this->server->addPlugin(new \Sabre\CalDAV\ICSExportPlugin());
$this->server->addPlugin(new \OCA\DAV\CalDAV\Schedule\Plugin());
$this->server->addPlugin(new IMipPlugin($mailer, $logger, $timezone));
if(\OC::$server->getConfig()->getSystemValue('caldav_send_invitations', true)) {
$this->server->addPlugin(new IMipPlugin($mailer, $logger, $timezone));
}
$this->server->addPlugin(new \Sabre\CalDAV\Subscriptions\Plugin());
$this->server->addPlugin(new \Sabre\CalDAV\Notifications\Plugin());
$this->server->addPlugin(new DAV\Sharing\Plugin($authBackend, \OC::$server->getRequest()));
Expand Down
6 changes: 5 additions & 1 deletion config/config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -1551,6 +1551,10 @@
/**
* show group membership on the personal page
*/
'settings.personal.showGroupMembership' => true
'settings.personal.showGroupMembership' => true,

/**
* send out invitations via Nextcloud's integrated CalDAV server
*/
'caldav_send_invitations' => true,
);

0 comments on commit 6d74321

Please sign in to comment.