mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-03-12 02:11:23 +00:00
Monotone-Parent: 433aaeac45e4077236372a5e04d1bbb6ff3c569f
Monotone-Revision: b9881036cb14d433a260903357497efadfdfbec6 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-08-06T20:26:47 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,5 +1,13 @@
|
||||
2010-08-06 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* UI/PreferencesUI/UIxPreferences.m (_extractAuxiliaryAccounts:):
|
||||
since we no longer transfer the user password to the client, the
|
||||
old password has to be fetched from the old account unless a new
|
||||
password has been set.
|
||||
(-mailAccounts): we now strip the passwords from the returned mail
|
||||
accounts, to avoid transferring them uselessly with a risk of
|
||||
keeping them in cache.
|
||||
|
||||
* UI/WebServerResources/MailerUI.js: (initMailboxTree): make use
|
||||
of the new class below and drop all code related to keeping track
|
||||
of active requests.
|
||||
|
||||
@@ -1152,7 +1152,7 @@
|
||||
- (BOOL) _validateAccount: (NSDictionary *) account
|
||||
{
|
||||
static NSString *accountKeys[] = { @"name", @"serverName", @"userName",
|
||||
@"password", nil };
|
||||
nil };
|
||||
static NSArray *knownKeys = nil;
|
||||
NSMutableDictionary *clone;
|
||||
NSString **key, *value;
|
||||
@@ -1203,9 +1203,15 @@
|
||||
|
||||
- (void) _extractAuxiliaryAccounts: (NSArray *) accounts
|
||||
{
|
||||
int count, max;
|
||||
int count, max, oldMax;
|
||||
NSArray *oldAccounts;
|
||||
NSMutableArray *auxAccounts;
|
||||
NSDictionary *account;
|
||||
NSDictionary *oldAccount;
|
||||
NSMutableDictionary *account;
|
||||
NSString *password;
|
||||
|
||||
oldAccounts = [user mailAccounts];
|
||||
oldMax = [oldAccounts count];
|
||||
|
||||
max = [accounts count];
|
||||
auxAccounts = [NSMutableArray arrayWithCapacity: max];
|
||||
@@ -1214,7 +1220,21 @@
|
||||
{
|
||||
account = [accounts objectAtIndex: count];
|
||||
if ([self _validateAccount: account])
|
||||
[auxAccounts addObject: account];
|
||||
{
|
||||
password = [account objectForKey: @"password"];
|
||||
if (!password)
|
||||
{
|
||||
if (count < oldMax)
|
||||
{
|
||||
oldAccount = [oldAccounts objectAtIndex: count];
|
||||
password = [oldAccount objectForKey: @"password"];
|
||||
}
|
||||
if (!password)
|
||||
password = @"";
|
||||
[account setObject: password forKey: @"password"];
|
||||
}
|
||||
[auxAccounts addObject: account];
|
||||
}
|
||||
}
|
||||
|
||||
[userDefaults setAuxiliaryMailAccounts: auxAccounts];
|
||||
@@ -1235,7 +1255,7 @@
|
||||
{
|
||||
[self _extractMainSignature: [accounts objectAtIndex: 0]];
|
||||
|
||||
if (max > 1 && [self mailAuxiliaryUserAccountsEnabled])
|
||||
if ([self mailAuxiliaryUserAccountsEnabled])
|
||||
[self _extractAuxiliaryAccounts: accounts];
|
||||
}
|
||||
}
|
||||
@@ -1244,8 +1264,16 @@
|
||||
- (NSString *) mailAccounts
|
||||
{
|
||||
NSArray *accounts;
|
||||
NSMutableDictionary *account;
|
||||
int count, max;
|
||||
|
||||
accounts = [user mailAccounts];
|
||||
max = [accounts count];
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
account = [accounts objectAtIndex: count];
|
||||
[account removeObjectForKey: @"password"];
|
||||
}
|
||||
|
||||
return [accounts jsonRepresentation];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user