mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-11-21 23:12:40 +00:00
Monotone-Parent: 50626dad4bfc5d3baa2556f6d16ca3eb3cc21bb6
Monotone-Revision: f6dd6e26aadfa52716bf3ca2c504de3593e5f35b Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-11-23T13:53:54 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
1 parent
d89a194aa9
commit
e4956f5d1f
5 files changed
+57
-16
No files matched your search
@@ -112,6 +112,7 @@ static NSString *userAgent = nil;
|
||||
sourceURL = nil;
|
||||
sourceFlag = nil;
|
||||
inReplyTo = nil;
|
||||
isHTML = NO;
|
||||
}
|
||||
|
||||
return self;
|
||||
@@ -252,6 +253,16 @@ static NSString *userAgent = nil;
|
||||
return text;
|
||||
}
|
||||
|
||||
- (void) setIsHTML: (BOOL) aBool
|
||||
{
|
||||
isHTML = aBool;
|
||||
}
|
||||
|
||||
- (BOOL) isHTML
|
||||
{
|
||||
return isHTML;
|
||||
}
|
||||
|
||||
- (void) setInReplyTo: (NSString *) newInReplyTo
|
||||
{
|
||||
ASSIGN (inReplyTo, newInReplyTo);
|
||||
@@ -307,6 +318,8 @@ static NSString *userAgent = nil;
|
||||
[infos setObject: headers forKey: @"headers"];
|
||||
if (text)
|
||||
[infos setObject: text forKey: @"text"];
|
||||
[infos setObject: [NSNumber numberWithBool: isHTML]
|
||||
forKey: @"isHTML"];
|
||||
if (inReplyTo)
|
||||
[infos setObject: inReplyTo forKey: @"inReplyTo"];
|
||||
if (IMAP4ID > -1)
|
||||
@@ -351,6 +364,7 @@ static NSString *userAgent = nil;
|
||||
value = [infoDict objectForKey: @"text"];
|
||||
if ([value length] > 0)
|
||||
[self setText: value];
|
||||
isHTML = [[infoDict objectForKey: @"isHTML"] boolValue];
|
||||
|
||||
value = [infoDict objectForKey: @"IMAP4ID"];
|
||||
if (value)
|
||||
@@ -895,13 +909,8 @@ static NSString *userAgent = nil;
|
||||
// TODO: set charset in header!
|
||||
[map setObject: @"text/plain" forKey: @"content-type"];
|
||||
if (text)
|
||||
{
|
||||
if ([[ud mailComposeMessageType] isEqualToString: @"html"])
|
||||
[map setObject: htmlContentTypeValue
|
||||
forKey: @"content-type"];
|
||||
else
|
||||
[map setObject: contentTypeValue forKey: @"content-type"];
|
||||
}
|
||||
[map setObject: (isHTML ? htmlContentTypeValue : contentTypeValue)
|
||||
forKey: @"content-type"];
|
||||
|
||||
// if ((body = text) != nil) {
|
||||
// if ([body isKindOfClass: [NSString class]]) {
|
||||
@@ -934,12 +943,8 @@ static NSString *userAgent = nil;
|
||||
{
|
||||
// if ([body isKindOfClass:[NSString class]])
|
||||
/* Note: just 'utf8' is displayed wrong in Mail.app */
|
||||
if ([[ud mailComposeMessageType] isEqualToString: @"html"])
|
||||
[map setObject: htmlContentTypeValue
|
||||
forKey: @"content-type"];
|
||||
else
|
||||
[map setObject: contentTypeValue
|
||||
forKey: @"content-type"];
|
||||
[map setObject: (isHTML ? htmlContentTypeValue : contentTypeValue)
|
||||
forKey: @"content-type"];
|
||||
// body = [body dataUsingEncoding:NSUTF8StringEncoding];
|
||||
// else if ([body isKindOfClass:[NSData class]] && addSuffix) {
|
||||
// body = [[body mutableCopy] autorelease];
|
||||
@@ -949,13 +954,12 @@ static NSString *userAgent = nil;
|
||||
// NSStringFromClass([body class])];
|
||||
// }
|
||||
|
||||
message = [[[NGMimeMessage alloc] initWithHeader:map] autorelease];
|
||||
[message setBody: body];
|
||||
message = [[[NGMimeMessage alloc] initWithHeader:map] autorelease];
|
||||
[message setBody: body];
|
||||
}
|
||||
else
|
||||
message = nil;
|
||||
|
||||
|
||||
return message;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user