fix(preferences(js)): sanitize mail identities when saving
parent
64a8ce4048
commit
aa706796c2
|
@ -1504,7 +1504,7 @@ static NSArray *reminderValues = nil;
|
||||||
[v setObject: [[user userDefaults] mailCertificate] forKey: @"SOGoMailCertificate"];
|
[v setObject: [[user userDefaults] mailCertificate] forKey: @"SOGoMailCertificate"];
|
||||||
|
|
||||||
//
|
//
|
||||||
// We sanitize our auxilary mail accounts
|
// We sanitize our auxiliary mail accounts
|
||||||
//
|
//
|
||||||
accounts = [v objectForKey: @"AuxiliaryMailAccounts"];
|
accounts = [v objectForKey: @"AuxiliaryMailAccounts"];
|
||||||
if (accounts && [accounts isKindOfClass: [NSArray class]])
|
if (accounts && [accounts isKindOfClass: [NSArray class]])
|
||||||
|
|
|
@ -687,6 +687,16 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// See Account.prototype.$omit
|
||||||
|
_.forEach(preferences.defaults.AuxiliaryMailAccounts, function (account) {
|
||||||
|
var identities = [];
|
||||||
|
_.forEach(account.identities, function (identity) {
|
||||||
|
if (!identity.isReadOnly)
|
||||||
|
identities.push(_.pick(identity, ['email', 'fullName', 'replyTo', 'signature', 'isDefault']));
|
||||||
|
});
|
||||||
|
account.identities = identities;
|
||||||
|
});
|
||||||
|
|
||||||
if (!preferences.defaults.SOGoMailComposeWindowEnabled)
|
if (!preferences.defaults.SOGoMailComposeWindowEnabled)
|
||||||
delete preferences.defaults.SOGoMailComposeWindow;
|
delete preferences.defaults.SOGoMailComposeWindow;
|
||||||
delete preferences.defaults.SOGoMailComposeWindowEnabled;
|
delete preferences.defaults.SOGoMailComposeWindowEnabled;
|
||||||
|
|
Loading…
Reference in New Issue