feat(notification): add enotify sieve script

This commit is contained in:
Hivert Quentin
2023-08-29 10:07:53 +02:00
parent 4f7c73143f
commit 82b69d1414
16 changed files with 223 additions and 21 deletions
@@ -80,6 +80,9 @@
"You are not allowed to forward your messages to an internal email address." = "You are not allowed to forward your messages to an internal email address.";
"You are not allowed to forward your messages to this domain:" = "You are not allowed to forward your messages to this domain:";
/* notification */
"Notify incoming messsages" = "Notify incoming messsages";
/* d & t */
"Time Zone" = "Time Zone";
"Short Date Format" = "Short Date Format";
@@ -411,6 +414,7 @@
"Keep the message" = "Keep the message";
"Forward the message to" = "Forward the message to";
"Notify the message to" = "Notify the message to";
/* Input field label of "forward" mail filter action */
"Email" = "Email";
@@ -68,7 +68,7 @@
= "La date de fin de la réponse automatique doit être dans le futur.";
/* forward messages */
"Forward incoming messages" = "Transférer les messages entrant";
"Forward incoming messages" = "Transférer les messages entrants";
"Always forward" = "Toujours transférer";
"Incoming messages are forwarded prior to apply your filters." = "Le courrier entrant est transféré d'appliquer vos filtres.";
"Keep a copy" = "Garder une copie";
@@ -80,6 +80,9 @@
"You are not allowed to forward your messages to an internal email address." = "Il est interdit de renvoyer vos messages vers une adresse interne.";
"You are not allowed to forward your messages to this domain:" = "Vous ne pouvez pas transférer vos messages à ce domaine :";
/* notify messages */
"Notify incoming messsages" = "Notifier les messages entrants";
/* d & t */
"Time Zone" = "Fuseau horaire";
"Short Date Format" = "Style de date courte";
@@ -411,6 +414,7 @@
"Keep the message" = "Conserver le message";
"Forward the message to" = "Faire suivre le message à";
"Notify the message to" = "Notifier le message à";
/* Input field label of "forward" mail filter action */
"Email" = "Email";
+8 -3
View File
@@ -395,9 +395,14 @@ static SoProduct *preferencesProduct = nil;
}
if ([domainDefaults forwardEnabled] && ![defaults forwardOptions])
{
[defaults setForwardOptions: [NSDictionary new]];
}
{
[defaults setForwardOptions: [NSDictionary new]];
}
if ([domainDefaults notificationEnabled] && ![defaults notificationOptions])
{
[defaults setNotificationOptions: [NSDictionary new]];
}
if ([[defaults source] dirty])
[defaults synchronize];
+1 -1
View File
@@ -42,7 +42,7 @@
// Sieve filtering
NSArray *daysOfWeek, *daysBetweenResponsesList;
NSArray *sieveFilters;
NSMutableDictionary *vacationOptions, *forwardOptions;
NSMutableDictionary *vacationOptions, *forwardOptions, *notificationOptions;
BOOL mailCustomFromEnabled;
BOOL forwardEnabled;
+20 -2
View File
@@ -136,13 +136,20 @@ static NSArray *reminderValues = nil;
vacationOptions = [NSMutableDictionary new];
}
if ([dd forwardEnabled])
if ([dd forwardEnabled])
{
forwardOptions = [[userDefaults forwardOptions] mutableCopy];
if (!forwardOptions)
forwardOptions = [NSMutableDictionary new];
}
if ([dd notificationEnabled])
{
notificationOptions = [[userDefaults notificationOptions] mutableCopy];
if (!notificationOptions)
notificationOptions = [NSMutableDictionary new];
}
mailCustomFromEnabled = [dd mailCustomFromEnabled];
forwardEnabled = [dd forwardEnabled];
@@ -160,6 +167,7 @@ static NSArray *reminderValues = nil;
[sieveFilters release];
[vacationOptions release];
[forwardOptions release];
[notificationOptions release];
[daysOfWeek release];
[addressBooksIDWithDisplayName release];
[client release];
@@ -989,6 +997,15 @@ static NSArray *reminderValues = nil;
return [domains jsonRepresentation];
}
/* mail notifications */
//
// Used by templates
//
- (BOOL) isNotificationEnabled
{
return [[user domainDefaults] notificationEnabled];
}
//
// Used by templates
//
@@ -1727,7 +1744,8 @@ static NSArray *reminderValues = nil;
dd = [[context activeUser] domainDefaults];
// We check if the Sieve server is available *ONLY* if at least one of the option is enabled
if (!([dd sieveScriptsEnabled] || [dd vacationEnabled] || [dd forwardEnabled]) || [self _isSieveServerAvailable])
if (([dd sieveScriptsEnabled] || [dd vacationEnabled] || [dd forwardEnabled] || [dd notificationEnabled])
|| [self _isSieveServerAvailable])
{
BOOL forceActivation = ![[v objectForKey: @"hasActiveExternalSieveScripts"] boolValue];