Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opt out of IMip CalDAV Plugin #6811

Merged
merged 2 commits into from
Oct 19, 2017

Conversation

georgehrke
Copy link
Member

@georgehrke georgehrke commented Oct 11, 2017

This pull-request makes it possible to opt out of the iMip Plugin for CalDAV. If disabled, the server will no longer send out emails to attendees. This was requested by many people.

I already implemented this earlier in #5304, but removed it again because of requested changes concerning the implementation.

In contrast to #5304, this pull-request doesn't use the config.php, but stores it in the database.

This pull-request adds a new GUI element:
c3285bf8-7c80-4ac1-938d-e4129d1a2af1

Config method besides GUI:

php occ config:app:set dav sendInvitations --value yes/no

@georgehrke georgehrke added the 2. developing Work in progress label Oct 11, 2017
@georgehrke georgehrke force-pushed the feature/noid/disable_caldav_invitations branch 5 times, most recently from bb9c732 to eeec9de Compare October 11, 2017 11:33
@georgehrke georgehrke assigned georgehrke and unassigned georgehrke Oct 15, 2017
@georgehrke georgehrke added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Oct 15, 2017
@georgehrke
Copy link
Member Author

to test this:

  • setup email properly
  • make sure option is enabled
  • create event (in the future) with attendee
  • make sure email was sent
  • disable option
  • create event (in the future) with attendee
  • make sure email was not sent

@@ -52,6 +52,7 @@
$calDavBackend = new CalDavBackend($db, $principalBackend, $userManager, $random, $dispatcher, true);

$debugging = \OC::$server->getConfig()->getSystemValue('debug', false);
$sendInvitations = (\OC::$server->getConfig()->getAppValue('dav', 'sendInvitations', 'yes') === 'yes');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove brackets

"use strict";

$('#caldavSendInvitations').change(function() {
var url = OC.generateUrl('/apps/dav/setSendInvitations');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use OCP.AppConfig.setValue('dav', 'sendInvitations', ...)

Then you can drop your controller as well

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good hint! Will change that accordingly

@@ -76,6 +76,7 @@ public function __construct(IRequest $request, $baseUri) {
$mailer = \OC::$server->getMailer();
$dispatcher = \OC::$server->getEventDispatcher();
$timezone = new TimeFactory();
$sendInvitations = (\OC::$server->getConfig()->getAppValue('dav', 'sendInvitations', 'yes') === 'yes');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove brackets

Signed-off-by: Georg Ehrke <developer@georgehrke.com>
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
@georgehrke georgehrke force-pushed the feature/noid/disable_caldav_invitations branch from eeec9de to b958725 Compare October 16, 2017 11:49
@georgehrke
Copy link
Member Author

removed brackets and using OCP.AppConfig now ✅

@@ -52,6 +52,7 @@
$calDavBackend = new CalDavBackend($db, $principalBackend, $userManager, $random, $dispatcher, true);

$debugging = \OC::$server->getConfig()->getSystemValue('debug', false);
$sendInvitations = \OC::$server->getConfig()->getAppValue('dav', 'sendInvitations', 'yes') === 'yes';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this useless variable and put the code directly into the if?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't if(\OC::$server->getConfig()->getAppValue('dav', 'sendInvitations', 'yes') === 'yes') { ... look really weird?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well same goes for this assignment ;)

@nickvergessen nickvergessen merged commit bb1af9b into master Oct 19, 2017
@nickvergessen nickvergessen deleted the feature/noid/disable_caldav_invitations branch October 19, 2017 09:58
@kosli
Copy link

kosli commented Feb 18, 2018

I tested the latest 13.0 release together with thunderbird lightning and even if the sending of the invitations is disabled on the NC side, TB doesn't ask about sending emails. Only if i disable the line with the schedule plugin ($server->addPlugin(new \OCA\DAV\CalDAV\Schedule\Plugin());) then it works as expected -> TB asks if it should send an invitation to the attendees. Can somebody confirm this? (after doing the change in Server.php you need to use the "reset calendar cache" option in TB).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants