Monotone-Parent: 07598ed25ba62374768b8640ed2ee37f0095224b

Monotone-Revision: e339a3442f42acdf4909a6baec00b5327ae53cb3

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-08-26T15:29:05
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2010-08-26 15:29:05 +00:00
parent 37561dadeb
commit a4488f234f
2 changed files with 5 additions and 17 deletions

View File

@@ -1,5 +1,9 @@
2010-08-26 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* UI/MailerUI/UIxMailEditor.m (_emailFromIdentity:): the "from"
field is handled in SOGoDraftObject, therefore we don't need to
modify it here, especially since this will alterate the display.
* Tests/Unit/TestNGMimeAddressHeaderFieldGenerator.m: new test
module for NGMimeAddressHeaderFieldGenerator.

View File

@@ -195,27 +195,11 @@ static NSArray *infoKeys = nil;
- (NSString *) _emailFromIdentity: (NSDictionary *) identity
{
static NSCharacterSet *specialCharacters = nil;
NSString *fullName, *format;
if (!specialCharacters)
{
/* This list is taken from rfc 822 sect. 3.3. LEXICAL TOKENS: */
specialCharacters = [NSCharacterSet
characterSetWithCharactersInString:
@"()<>@,;:\\\".[]"];
[specialCharacters retain];
}
fullName = [identity objectForKey: @"fullName"];
if ([fullName length])
{
if ([fullName rangeOfCharacterFromSet: specialCharacters].location
== NSNotFound)
format = @"%{fullName} <%{email}>";
else
format = @"\"%{fullName}\" <%{email}>";
}
format = @"%{fullName} <%{email}>";
else
format = @"%{email}";