From a310c3826c7d2cdda2e8f71b1dfe36b4c949f16e Mon Sep 17 00:00:00 2001 From: C Robert Date: Tue, 29 Sep 2009 21:07:22 +0000 Subject: [PATCH] Fixed an error when composing from address book Monotone-Parent: b092fe6aebfa4e00c827df976eaa7e49cb1c6539 Monotone-Revision: 97fb6bc6ccca9d15df3776811dafe8ad42650b90 Monotone-Author: crobert@inverse.ca Monotone-Date: 2009-09-29T21:07:22 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 2 ++ UI/MailerUI/UIxMailMainFrame.m | 11 +++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index bcdc0bd64..c7e288412 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16,6 +16,8 @@ PUT on a non-existing object. * UI/MailerUI/UIxMailMainFrame.m (mailAccounts): Changed the return value to include both the account name and display name. + * UI/MailerUI/UIxMailMainFrame.m: Fixed an error when composing from the + Address Book module. 2009-09-29 Wolfgang Sourdeau diff --git a/UI/MailerUI/UIxMailMainFrame.m b/UI/MailerUI/UIxMailMainFrame.m index 8338904e5..320b828f0 100644 --- a/UI/MailerUI/UIxMailMainFrame.m +++ b/UI/MailerUI/UIxMailMainFrame.m @@ -43,6 +43,7 @@ #import #import #import +#import #import #import #import @@ -175,7 +176,7 @@ { id contact; NSArray *accounts, *contactsId, *cards; - NSString *firstAccount, *newLocation, *parameters, *folderId, *uid; + NSString *firstAccount, *firstEscapedAccount, *newLocation, *parameters, *folderId, *uid; NSEnumerator *uids; NSMutableArray *addresses; NGVCard *card; @@ -192,7 +193,8 @@ // We use the first mail account accounts = [[context activeUser] mailAccounts]; firstAccount = [[accounts objectsForKey: @"name" notFoundMarker: nil] - objectAtIndex: 0]; + objectAtIndex: 0]; + firstEscapedAccount = [firstAccount asCSSIdentifier]; request = [context request]; if ((folderId = [request formValueForKey: @"folder"]) && @@ -237,7 +239,8 @@ } if ([addresses count] > 0) - parameters = [NSString stringWithFormat: @"?mailto=%@", [addresses componentsJoinedByString: @","]]; + parameters = [NSString stringWithFormat: @"?mailto=%@", + [addresses componentsJoinedByString: @","]]; } } else if ([[request formValues] objectForKey: @"mailto"]) @@ -250,7 +253,7 @@ newLocation = [NSString stringWithFormat: @"%@/%@/compose%@", [co baseURLInContext: context], - firstAccount, + firstEscapedAccount, parameters]; return [self redirectToLocation: newLocation];