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
+11 -1
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