mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-13 01:08:50 +00:00
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:
@@ -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.
|
||||
|
||||
@@ -43,6 +43,9 @@
|
||||
|
||||
- (NSString *) jsonRepresentation;
|
||||
|
||||
/* bare email addresses */
|
||||
- (NSString *) pureEMailAddress;
|
||||
|
||||
#ifndef GNUSTEP_BASE_LIBRARY
|
||||
- (BOOL) boolValue;
|
||||
#endif
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user