(js) Respect security preferences in mail editor
parent
7ebdac5525
commit
8e35becd93
|
@ -187,7 +187,7 @@
|
|||
</sg-checkmark>
|
||||
</md-menu-item>
|
||||
<md-menu-item>
|
||||
<md-button class="md-primary" ng-disabled="true"><var:string label:value="Security"/></md-button>
|
||||
<md-button class="md-primary" ng-disabled="true" ng-bind="::'Security' | loc"><!-- Security --></md-button>
|
||||
</md-menu-item>
|
||||
<md-menu-item>
|
||||
<sg-checkmark ng-model="editor.message.editable.sign">
|
||||
|
|
|
@ -358,6 +358,13 @@
|
|||
}).then(function(message) {
|
||||
// Fetch draft initial data
|
||||
return Account.$$resource.fetch(message.$absolutePath({asDraft: true}), 'edit').then(function(data) {
|
||||
var accountDefaults = Account.$Preferences.defaults.AuxiliaryMailAccounts[_this.id];
|
||||
if (accountDefaults.security) {
|
||||
if (accountDefaults.security.alwaysSign)
|
||||
data.sign = true;
|
||||
if (accountDefaults.security.alwaysEncrypt)
|
||||
data.encrypt = true;
|
||||
}
|
||||
Account.$log.debug('New message (edit): ' + JSON.stringify(data, undefined, 2));
|
||||
angular.extend(message.editable, data);
|
||||
message.isNew = true;
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
$timeout: $timeout,
|
||||
$log: $log,
|
||||
$$resource: new Resource(Settings.activeUser('folderURL') + 'Mail', Settings.activeUser()),
|
||||
$Preferences: Preferences,
|
||||
$avatar: angular.bind(Preferences, Preferences.avatar)
|
||||
});
|
||||
|
||||
|
@ -396,6 +397,13 @@
|
|||
});
|
||||
if (identity)
|
||||
data.from = identity.full;
|
||||
var accountDefaults = Message.$Preferences.defaults.AuxiliaryMailAccounts[_this.$mailbox.$account.id];
|
||||
if (accountDefaults.security) {
|
||||
if (accountDefaults.security.alwaysSign)
|
||||
data.sign = true;
|
||||
if (accountDefaults.security.alwaysEncrypt)
|
||||
data.encrypt = true;
|
||||
}
|
||||
Message.$log.debug('editable = ' + JSON.stringify(data, undefined, 2));
|
||||
angular.extend(_this.editable, data);
|
||||
return data.text;
|
||||
|
|
Loading…
Reference in New Issue