Revision c87a1e4f trunk/Pithos.Client.WPF/Preferences/PreferencesViewModel.cs
b/trunk/Pithos.Client.WPF/Preferences/PreferencesViewModel.cs | ||
---|---|---|
287 | 287 |
return; |
288 | 288 |
//The server will return credentials for a different account, not just the current account |
289 | 289 |
//We need to find the correct account first |
290 |
var account = |
|
291 |
Accounts.First( |
|
292 |
act => act.AccountName == credentials.UserName && act.ServerUrl == CurrentAccount.ServerUrl); |
|
290 |
AccountViewModel account=null; |
|
291 |
Guid token; |
|
292 |
if (Guid.TryParse(name, out token)) |
|
293 |
{ |
|
294 |
account = |
|
295 |
Accounts.First( |
|
296 |
act => act.AccountName == credentials.UserName && act.ServerUrl == CurrentAccount.ServerUrl); |
|
297 |
} |
|
298 |
else |
|
299 |
{ |
|
300 |
account = |
|
301 |
Accounts.First( |
|
302 |
act => act.AccountName == name && act.ServerUrl == CurrentAccount.ServerUrl); |
|
303 |
account.AccountName = credentials.UserName; |
|
304 |
|
|
305 |
} |
|
293 | 306 |
account.ApiKey = credentials.Password; |
294 | 307 |
account.IsExpired = false; |
295 | 308 |
Settings.Save(); |
... | ... | |
513 | 526 |
if (Guid.TryParse(wizard.AccountName, out token)) |
514 | 527 |
{ |
515 | 528 |
newAccount.AccountToken = token; |
516 |
newAccount.DisplayName = await client.ResolveToken(token).ConfigureAwait(false);
|
|
529 |
newAccount.DisplayName = await client.ResolveName(token).ConfigureAwait(false);
|
|
517 | 530 |
} |
518 | 531 |
|
519 | 532 |
|
Also available in: Unified diff