Monotone-Parent: 890780f417605e8803bbe725196d6f559c8a11c7

Monotone-Revision: e0eb29facb0dd67a0b0623858dfb42b49f7e090b

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-08-09T20:59:30
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2007-08-09 20:59:30 +00:00
parent 578d84b216
commit dc3d206984
3 changed files with 27 additions and 0 deletions

View File

@@ -1,5 +1,10 @@
2007-08-09 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/SOGo/NSString+Utilities.m ([NSString
-pureEMailAddress]): new utility method inspired by the
"_rawSender" private method in SOGoDraftObject, which it now
replaces.
* SoObjects/SOGo/SOGoMailer.m: new abstraction class module that
provides a common API for sending emails, no matter what the
transport is.

View File

@@ -43,6 +43,9 @@
- (NSString *) jsonRepresentation;
/* bare email addresses */
- (NSString *) pureEMailAddress;
#ifndef GNUSTEP_BASE_LIBRARY
- (BOOL) boolValue;
#endif

View File

@@ -249,6 +249,25 @@ static NSMutableCharacterSet *urlAfterEndingChars = nil;
return [NSString stringWithFormat: @"\"%@\"", representation];
}
- (NSString *) pureEMailAddress
{
NSString *pureAddress;
NSRange delimiter;
delimiter = [self rangeOfString: @"<"];
if (delimiter.location == NSNotFound)
pureAddress = self;
else
{
pureAddress = [self substringFromIndex: NSMaxRange (delimiter)];
delimiter = [pureAddress rangeOfString: @">"];
if (delimiter.location != NSNotFound)
pureAddress = [pureAddress substringToIndex: delimiter.location];
}
return pureAddress;
}
#if LIB_FOUNDATION_LIBRARY
- (BOOL) boolValue
{