feat(calendar): Add option to disable email appointmoint notifications when using caldav

This commit is contained in:
smizrahi
2024-06-12 12:00:41 +02:00
parent 4b343f7070
commit 2637434436
4 changed files with 19 additions and 1 deletions

View File

@@ -806,6 +806,7 @@
ownerUser = [SOGoUser userWithLogin: owner];
dd = [ownerUser domainDefaults];
if ([dd appointmentSendEMailNotifications] && [object isStillRelevant])
{
count = [attendees count];
@@ -1033,6 +1034,8 @@
to: (iCalPerson *) recipient
{
SOGoDomainDefaults *dd;
SOGoUserSettings *settings;
BOOL canSendNotification, doNotSendNotificationOnCalDav;
// We never send IMIP reply when the "initiator" is Outlook 2013/2016 over
// the EAS protocol. That is because Outlook will always issue a SendMail command
@@ -1042,8 +1045,15 @@
if ([[context objectForKey: @"DeviceType"] isEqualToString: @"WindowsOutlook15"])
return;
canSendNotification = NO;
settings = [from userSettings];
doNotSendNotificationOnCalDav = ([settings objectForKey: @"Calendar"]
&& [[settings objectForKey: @"Calendar"] objectForKey: @"InvitationNotificationsOnCalDavDisabled"]
&& 1 == [[[settings objectForKey: @"Calendar"] objectForKey: @"InvitationNotificationsOnCalDavDisabled"] intValue]);
canSendNotification = !doNotSendNotificationOnCalDav || !(doNotSendNotificationOnCalDav && [[context request] isSoWebDAVRequest]);
dd = [from domainDefaults];
if ([dd appointmentSendEMailNotifications] && [event isStillRelevant])
if ([dd appointmentSendEMailNotifications] && [event isStillRelevant] && canSendNotification)
{
// We first send to the real recipient (organizer)
[self _sendIMIPReplyForEvent: event

View File

@@ -152,6 +152,7 @@
"Contacts Names" = "Contacts Names";
"Duplicate name" = "Duplicate name";
"Calendar categories must have unique names." = "Calendar categories must have unique names.";
"Disable e-mail notifications on CalDAV" = "Disable e-mail notifications on CalDAV";
/* Default Calendar */
"Default calendar" = "Default calendar";

View File

@@ -152,6 +152,7 @@
"Contacts Names" = "Noms des contacts";
"Duplicate name" = "Nom déjà utilisé";
"Calendar categories must have unique names." = "Les catégories doivent être uniques.";
"Disable e-mail notifications on CalDAV" = "Désactiver les notifications e-mail avec CalDAV";
/* Default Calendar */
"Default calendar" = "Calendrier par défaut";

View File

@@ -552,6 +552,12 @@
id="calendarInvitationsTab-content">
<div layout="column" flex="100">
<md-checkbox
ng-model="app.preferences.settings.Calendar.InvitationNotificationsOnCalDavDisabled"
ng-true-value="1"
ng-false-value="0">
<var:string label:value="Disable e-mail notifications on CalDAV"/>
</md-checkbox>
<md-checkbox
ng-model="app.preferences.settings.Calendar.PreventInvitations"
ng-true-value="1"