Fix support for SOGoSieveFolderEncoding defaults

Fixed the following bugs in the mail filter editor:

1. Sieve folder encoding not respecting the SOGoSieveFolderEncoding
system defaults;
2. Conditions are still displayed when rule affects all messages;
3. Missing custom mail labels to "flag with" action.
pull/225/head
Francis Lachapelle 2016-11-17 09:41:15 -05:00
parent 5f70555975
commit baf1d44548
7 changed files with 36 additions and 9 deletions

1
NEWS
View File

@ -20,6 +20,7 @@ Bug fixes
- [web] fixed and improved IMAP folder subscriptions manager (#3865)
- [web] fixed Sieve script activation when vacation start date is in the future (#3885)
- [web] fixed moving a component without the proper rights (#3889)
- [web] restored Sieve folder encoding support (#3904)
3.2.1 (2016-11-02)
------------------

View File

@ -319,11 +319,27 @@
"Header" = "Header";
"Body" = "Body";
"Flag the message with" = "Flag the message with";
/* Select field label of "flag message" mail filter action */
"Flag" = "Flag";
"Discard the message" = "Discard the message";
"File the message in" = "File the message in";
/* Select field label of "file message" mail filter action */
"Mailbox" = "Mailbox";
"Keep the message" = "Keep the message";
"Forward the message to" = "Forward the message to";
/* Input field label of "forward" mail filter action */
"Email" = "Email";
"Send a reject message" = "Send a reject message";
/* Input field label of "reject" mail filter action */
"Message" = "Message";
"Send a vacation message" = "Send a vacation message";
"Stop processing filter rules" = "Stop processing filter rules";
"is under" = "is under";

View File

@ -111,9 +111,4 @@
return [labels jsonRepresentation];
}
- (NSString *) sieveFolderEncoding
{
return [[SOGoSystemDefaults sharedSystemDefaults] sieveFolderEncoding];
}
@end

View File

@ -1622,6 +1622,14 @@ static NSArray *reminderValues = nil;
userCanChangePassword];
}
//
// Used wox by template
//
- (NSString *) sieveFolderEncoding
{
return [[SOGoSystemDefaults sharedSystemDefaults] sieveFolderEncoding];
}
// - (NSString *) localeCode
// {
// // WARNING : NSLocaleCode is not defined in <Foundation/NSUserDefaults.h>

View File

@ -26,7 +26,6 @@
<md-dialog-content class="sg-has-form-sections">
<script type="text/javascript">
var filterId = '<var:string value="filterId"/>';
var sieveFolderEncoding = '<var:string value="sieveFolderEncoding"/>';
var mailTags = <var:string value="labels" const:escapeHTML="NO"/>;
</script>
@ -51,7 +50,7 @@
</div>
<!-- CONDITIONS -->
<div layout="column">
<div layout="column" ng-hide="filterEditor.filter.match == 'allmessages'">
<div id="filterRules"><!-- empty --></div>
<div layout="row" layout-align="start center"
ng-repeat="rule in filterEditor.filter.rules">
@ -165,7 +164,7 @@
<md-option value="flagged"><var:string label:value="Flagged"/></md-option>
<md-option value="junk"><var:string label:value="Junk"/></md-option>
<md-option value="not_junk"><var:string label:value="Not Junk"/></md-option>
<md-option ng-value="key" ng-repeat="(key, value) in labels">{{ value[0] }}</md-option>
<md-option ng-value="key" ng-repeat="(key, value) in filterEditor.labels">{{ value[0] }}</md-option>
</md-select>
</md-input-container>

View File

@ -21,6 +21,7 @@
var defaultEmailAddresses = '<var:string value="defaultEmailAddresses" const:escapeHTML="NO"/>';
var forwardConstraints = <var:string value="forwardConstraints" const:escapeHTML="NO"/>;
var sieveCapabilities = <var:string value="sieveCapabilities" const:escapeHTML="NO"/>;
var sieveFolderEncoding = <var:string value="sieveFolderEncoding.doubleQuotedString"/>;
</script>
<script type="text/ng-template" id="preferences.html">

View File

@ -12,7 +12,8 @@
var vm = this,
sieveCapabilities = $window.sieveCapabilities,
forwardEnabled = $window.forwardEnabled,
vacationEnabled = $window.vacationEnabled;
vacationEnabled = $window.vacationEnabled,
sieveFolderPathAttribute = ($window.sieveFolderEncoding == "UTF-8") ? "name" : "path";
vm.filter = filter;
vm.mailboxes = mailboxes;
@ -50,6 +51,12 @@
//if (vacationEnabled)
// vm.methodLabels.vacation = l("Send a vacation message");
vm.mailboxes = _.map(mailboxes, function(mailbox) {
return { level: mailbox.level,
name: mailbox.name,
path: mailbox[sieveFolderPathAttribute] };
});
if (sieveCapabilities.indexOf("reject") > -1)
vm.methodLabels.reject = l("Send a reject message");