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];