merge of '465796f786a1b25ed73a3ba4064f4a51bf6f3a62'

and '64aa83e8cd0a166c047f31a255fba032c405fbf9'

Monotone-Parent: 465796f786a1b25ed73a3ba4064f4a51bf6f3a62
Monotone-Parent: 64aa83e8cd0a166c047f31a255fba032c405fbf9
Monotone-Revision: c9c5d4c2459dece2bf7417926d244b1088f86576

Monotone-Author: ludovic@Sophos.ca
Monotone-Date: 2008-09-05T15:03:02
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Ludovic Marcotte
2008-09-05 15:03:02 +00:00
19 changed files with 478 additions and 65 deletions
+6
View File
@@ -1,5 +1,11 @@
2008-09-05 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/Mailer/SOGoMailReply.m: made class a child of
SOGoMailForward, since we need to access more or less the same
fields from the original message, especially in outlook reply mode.
([SOGoMailReply -setOutlookMode:newOutlookMode]): new accessor
defining in which mode we are.
* SoObjects/Mailer/SOGoMailObject+Draft.m ([SOGoMailObject
-contentForReply]): if the reply style is outlook, then we use the
content generated for inline forwarding.
+1
View File
@@ -25,6 +25,7 @@
#import <NGExtensions/NGBase64Coding.h>
#import <NGExtensions/NGQuotedPrintableCoding.h>
#import <NGExtensions/NGExtensions/NSString+Encoding.h>
#import "NSData+Mail.h"
@@ -1,4 +1,10 @@
On <#date/>, <#from/> wrote:
<#outlookMode>-------- Original Message --------
Subject: <#subject/>
Date: <#date/>
From: <#from/>
<#hasReplyTo>Reply-To: <#replyTo/></#hasReplyTo><#hasOrganization>Organization: <#organization/></#hasOrganization>To: <#to/>
<#hasCc>CC: <#cc/></#hasCc><#hasNewsGroups>Newsgroups: <#newsgroups/></#hasNewsGroups><#hasReferences>References: <#references/></#hasReferences></#outlookMode>
<#standardMode>On <#date/>, <#from/> wrote:</#standardMode>
<#messageBody/>
@@ -1,3 +1,17 @@
outlookMode: WOConditional {
condition = outlookMode;
}
standardMode: WOConditional {
condition = outlookMode;
negate = YES;
}
subject: WOString {
value = subject;
escapeHTML = NO;
}
date: WOString {
value = date;
escapeHTML = NO;
@@ -8,6 +22,56 @@ from: WOString {
escapeHTML = NO;
}
hasReplyTo: WOConditional {
condition = hasReplyTo;
}
replyTo: WOString {
value = replyTo;
escapeHTML = NO;
}
hasOrganization: WOConditional {
condition = hasOrganization;
}
organization: WOString {
value = organization;
escapeHTML = NO;
}
to: WOString {
value = to;
escapeHTML = NO;
}
hasCc: WOConditional {
condition = hasCc;
}
cc: WOString {
value = cc;
escapeHTML = NO;
}
hasNewsGroups: WOConditional {
condition = hasNewsGroups;
}
newsgroups: WOString {
value = newsgroups;
escapeHTML = NO;
}
hasReferences: WOConditional {
condition = hasReferences;
}
references: WOString {
value = references;
escapeHTML = NO;
}
messageBody: WOString {
value = messageBody;
escapeHTML = NO;
@@ -1,4 +1,10 @@
On <#date/>, <#from/> wrote:
<#outlookMode>-------- Original Message --------
Subject: <#subject/>
Date: <#date/>
From: <#from/>
<#hasReplyTo>Reply-To: <#replyTo/></#hasReplyTo><#hasOrganization>Organization: <#organization/></#hasOrganization>To: <#to/>
<#hasCc>CC: <#cc/></#hasCc><#hasNewsGroups>Newsgroups: <#newsgroups/></#hasNewsGroups><#hasReferences>References: <#references/></#hasReferences></#outlookMode>
<#standardMode>On <#date/>, <#from/> wrote:</#standardMode>
<#messageBody/>
@@ -1,3 +1,17 @@
outlookMode: WOConditional {
condition = outlookMode;
}
standardMode: WOConditional {
condition = outlookMode;
negate = YES;
}
subject: WOString {
value = subject;
escapeHTML = NO;
}
date: WOString {
value = date;
escapeHTML = NO;
@@ -8,6 +22,56 @@ from: WOString {
escapeHTML = NO;
}
hasReplyTo: WOConditional {
condition = hasReplyTo;
}
replyTo: WOString {
value = replyTo;
escapeHTML = NO;
}
hasOrganization: WOConditional {
condition = hasOrganization;
}
organization: WOString {
value = organization;
escapeHTML = NO;
}
to: WOString {
value = to;
escapeHTML = NO;
}
hasCc: WOConditional {
condition = hasCc;
}
cc: WOString {
value = cc;
escapeHTML = NO;
}
hasNewsGroups: WOConditional {
condition = hasNewsGroups;
}
newsgroups: WOString {
value = newsgroups;
escapeHTML = NO;
}
hasReferences: WOConditional {
condition = hasReferences;
}
references: WOString {
value = references;
escapeHTML = NO;
}
messageBody: WOString {
value = messageBody;
escapeHTML = NO;
+7 -1
View File
@@ -34,10 +34,13 @@
NSString *currentValue;
}
- (void) setForwardedMail: (SOGoMailObject *) newSourceMail;
- (void) setSourceMail: (SOGoMailObject *) newSourceMail;
@end
@interface SOGoMailDutchForward : SOGoMailForward
@end
@interface SOGoMailEnglishForward : SOGoMailForward
@end
@@ -50,4 +53,7 @@
@interface SOGoMailItalianForward : SOGoMailForward
@end
@interface SOGoMailSpanishForward : SOGoMailForward
@end
#endif /* SOGOMAILFORWARD_H */
+6 -1
View File
@@ -48,7 +48,7 @@
[super dealloc];
}
- (void) setForwardedMail: (SOGoMailObject *) newSourceMail
- (void) setSourceMail: (SOGoMailObject *) newSourceMail
{
ASSIGN (sourceMail, newSourceMail);
}
@@ -164,6 +164,9 @@
@end
@implementation SOGoMailDutchForward
@end
@implementation SOGoMailEnglishForward
@end
@@ -176,3 +179,5 @@
@implementation SOGoMailItalianForward
@end
@implementation SOGoMailSpanishForward
@end
@@ -1,4 +1,10 @@
Le <#date/>, <#from/> a écrit:
<#outlookMode>-------- Original Message --------
Subject: <#subject/>
Date: <#date/>
From: <#from/>
<#hasReplyTo>Reply-To: <#replyTo/></#hasReplyTo><#hasOrganization>Organization: <#organization/></#hasOrganization>To: <#to/>
<#hasCc>CC: <#cc/></#hasCc><#hasNewsGroups>Newsgroups: <#newsgroups/></#hasNewsGroups><#hasReferences>References: <#references/></#hasReferences></#outlookMode>
<#standardMode>Le <#date/>, <#from/> a écrit:</#standardMode>
<#messageBody/>
@@ -1,3 +1,17 @@
outlookMode: WOConditional {
condition = outlookMode;
}
standardMode: WOConditional {
condition = outlookMode;
negate = YES;
}
subject: WOString {
value = subject;
escapeHTML = NO;
}
date: WOString {
value = date;
escapeHTML = NO;
@@ -8,6 +22,56 @@ from: WOString {
escapeHTML = NO;
}
hasReplyTo: WOConditional {
condition = hasReplyTo;
}
replyTo: WOString {
value = replyTo;
escapeHTML = NO;
}
hasOrganization: WOConditional {
condition = hasOrganization;
}
organization: WOString {
value = organization;
escapeHTML = NO;
}
to: WOString {
value = to;
escapeHTML = NO;
}
hasCc: WOConditional {
condition = hasCc;
}
cc: WOString {
value = cc;
escapeHTML = NO;
}
hasNewsGroups: WOConditional {
condition = hasNewsGroups;
}
newsgroups: WOString {
value = newsgroups;
escapeHTML = NO;
}
hasReferences: WOConditional {
condition = hasReferences;
}
references: WOString {
value = references;
escapeHTML = NO;
}
messageBody: WOString {
value = messageBody;
escapeHTML = NO;
@@ -1,4 +1,10 @@
On <#date/>, <#from/> wrote:
<#outlookMode>-------- Original Message --------
Subject: <#subject/>
Date: <#date/>
From: <#from/>
<#hasReplyTo>Reply-To: <#replyTo/></#hasReplyTo><#hasOrganization>Organization: <#organization/></#hasOrganization>To: <#to/>
<#hasCc>CC: <#cc/></#hasCc><#hasNewsGroups>Newsgroups: <#newsgroups/></#hasNewsGroups><#hasReferences>References: <#references/></#hasReferences></#outlookMode>
<#standardMode>On <#date/>, <#from/> wrote:</#standardMode>
<#messageBody/>
@@ -1,3 +1,17 @@
outlookMode: WOConditional {
condition = outlookMode;
}
standardMode: WOConditional {
condition = outlookMode;
negate = YES;
}
subject: WOString {
value = subject;
escapeHTML = NO;
}
date: WOString {
value = date;
escapeHTML = NO;
@@ -8,6 +22,56 @@ from: WOString {
escapeHTML = NO;
}
hasReplyTo: WOConditional {
condition = hasReplyTo;
}
replyTo: WOString {
value = replyTo;
escapeHTML = NO;
}
hasOrganization: WOConditional {
condition = hasOrganization;
}
organization: WOString {
value = organization;
escapeHTML = NO;
}
to: WOString {
value = to;
escapeHTML = NO;
}
hasCc: WOConditional {
condition = hasCc;
}
cc: WOString {
value = cc;
escapeHTML = NO;
}
hasNewsGroups: WOConditional {
condition = hasNewsGroups;
}
newsgroups: WOString {
value = newsgroups;
escapeHTML = NO;
}
hasReferences: WOConditional {
condition = hasReferences;
}
references: WOString {
value = references;
escapeHTML = NO;
}
messageBody: WOString {
value = messageBody;
escapeHTML = NO;
@@ -1,4 +1,10 @@
Il giorno <#date/>, <#from/> ha scritto:
<#outlookMode>-------- Original Message --------
Subject: <#subject/>
Date: <#date/>
From: <#from/>
<#hasReplyTo>Reply-To: <#replyTo/></#hasReplyTo><#hasOrganization>Organization: <#organization/></#hasOrganization>To: <#to/>
<#hasCc>CC: <#cc/></#hasCc><#hasNewsGroups>Newsgroups: <#newsgroups/></#hasNewsGroups><#hasReferences>References: <#references/></#hasReferences></#outlookMode>
<#standardMode>Il giorno <#date/>, <#from/> ha scritto:</#standardMode>
<#messageBody/>
@@ -1,4 +1,18 @@
date: WOString {
outlookMode: WOConditional {
condition = outlookMode;
}
standardMode: WOConditional {
condition = outlookMode;
negate = YES;
}
subject: WOString {
value = subject;
escapeHTML = NO;
}
date: WOString {
value = date;
escapeHTML = NO;
}
@@ -8,6 +22,56 @@ from: WOString {
escapeHTML = NO;
}
hasReplyTo: WOConditional {
condition = hasReplyTo;
}
replyTo: WOString {
value = replyTo;
escapeHTML = NO;
}
hasOrganization: WOConditional {
condition = hasOrganization;
}
organization: WOString {
value = organization;
escapeHTML = NO;
}
to: WOString {
value = to;
escapeHTML = NO;
}
hasCc: WOConditional {
condition = hasCc;
}
cc: WOString {
value = cc;
escapeHTML = NO;
}
hasNewsGroups: WOConditional {
condition = hasNewsGroups;
}
newsgroups: WOString {
value = newsgroups;
escapeHTML = NO;
}
hasReferences: WOConditional {
condition = hasReferences;
}
references: WOString {
value = references;
escapeHTML = NO;
}
messageBody: WOString {
value = messageBody;
escapeHTML = NO;
+11 -16
View File
@@ -147,23 +147,18 @@
- (NSString *) contentForReply
{
SOGoUser *currentUser;
NSString *pageName, *replyContent;
NSString *pageName;
SOGoMailReply *page;
if ([self useOutlookStyleReplies])
replyContent = [self contentForInlineForward];
else
{
currentUser = [context activeUser];
pageName = [NSString stringWithFormat: @"SOGoMail%@Reply",
[currentUser language]];
page = [[WOApplication application] pageWithName: pageName
inContext: context];
[page setRepliedMail: self];
replyContent = [[page generateResponse] contentAsString];
}
return replyContent;
currentUser = [context activeUser];
pageName = [NSString stringWithFormat: @"SOGoMail%@Reply",
[currentUser language]];
page = [[WOApplication application] pageWithName: pageName
inContext: context];
[page setSourceMail: self];
[page setOutlookMode: [self useOutlookStyleReplies]];
return [[page generateResponse] contentAsString];
}
- (NSString *) filenameForForward
@@ -223,7 +218,7 @@
[currentUser language]];
page = [[WOApplication application] pageWithName: pageName
inContext: context];
[page setForwardedMail: self];
[page setSourceMail: self];
return [[page generateResponse] contentAsString];
}
+11 -6
View File
@@ -23,21 +23,23 @@
#ifndef SOGOMAILREPLY_H
#define SOGOMAILREPLY_H
#import <NGObjWeb/SoComponent.h>
#import "SOGoMailForward.h"
@class SOGoMailObject;
@interface SOGoMailReply : SoComponent
@interface SOGoMailReply : SOGoMailForward
{
SOGoMailObject *sourceMail;
NSString *field;
NSString *currentValue;
BOOL outlookMode;
}
- (void) setRepliedMail: (SOGoMailObject *) newSourceMail;
- (void) setOutlookMode: (BOOL) newOutlookMode;
- (BOOL) outlookMode;
@end
@interface SOGoMailDutchReply : SOGoMailReply
@end
@interface SOGoMailEnglishReply : SOGoMailReply
@end
@@ -50,4 +52,7 @@
@interface SOGoMailItalianReply : SOGoMailReply
@end
@interface SOGoMailSpanishReply : SOGoMailReply
@end
#endif /* SOGOMAILREPLY_H */
+9 -34
View File
@@ -35,37 +35,20 @@
{
if ((self = [super init]))
{
sourceMail = nil;
currentValue = nil;
outlookMode = NO;
}
return self;
}
- (void) dealloc
- (void) setOutlookMode: (BOOL) newOutlookMode
{
[sourceMail release];
[currentValue release];
[super dealloc];
outlookMode = newOutlookMode;
}
- (void) setRepliedMail: (SOGoMailObject *) newSourceMail
- (BOOL) outlookMode
{
ASSIGN (sourceMail, newSourceMail);
}
- (NSString *) date
{
SOGoDateFormatter *formatter;
formatter = [[context activeUser] dateFormatterInContext: context];
return [formatter formattedDateAndTime: [sourceMail date]];
}
- (NSString *) from
{
return [[sourceMail mailHeaders] objectForKey: @"from"];
return outlookMode;
}
- (NSString *) messageBody
@@ -87,19 +70,9 @@
return [s stringByApplyingMailQuoting];
}
- (NSString *) signature
{
NSString *signature, *mailSignature;
signature = [[context activeUser] signature];
if ([signature length])
mailSignature = [NSString stringWithFormat: @"-- \n%@", signature];
else
mailSignature = @"";
return mailSignature;
}
@end
@implementation SOGoMailDutchReply
@end
@implementation SOGoMailEnglishReply
@@ -114,3 +87,5 @@
@implementation SOGoMailItalianReply
@end
@implementation SOGoMailSpanishReply
@end
@@ -1,4 +1,10 @@
On <#date/>, <#from/> wrote:
<#outlookMode>-------- Original Message --------
Subject: <#subject/>
Date: <#date/>
From: <#from/>
<#hasReplyTo>Reply-To: <#replyTo/></#hasReplyTo><#hasOrganization>Organization: <#organization/></#hasOrganization>To: <#to/>
<#hasCc>CC: <#cc/></#hasCc><#hasNewsGroups>Newsgroups: <#newsgroups/></#hasNewsGroups><#hasReferences>References: <#references/></#hasReferences></#outlookMode>
<#standardMode>On <#date/>, <#from/> wrote:</#standardMode>
<#messageBody/>
@@ -1,3 +1,17 @@
outlookMode: WOConditional {
condition = outlookMode;
}
standardMode: WOConditional {
condition = outlookMode;
negate = YES;
}
subject: WOString {
value = subject;
escapeHTML = NO;
}
date: WOString {
value = date;
escapeHTML = NO;
@@ -8,6 +22,56 @@ from: WOString {
escapeHTML = NO;
}
hasReplyTo: WOConditional {
condition = hasReplyTo;
}
replyTo: WOString {
value = replyTo;
escapeHTML = NO;
}
hasOrganization: WOConditional {
condition = hasOrganization;
}
organization: WOString {
value = organization;
escapeHTML = NO;
}
to: WOString {
value = to;
escapeHTML = NO;
}
hasCc: WOConditional {
condition = hasCc;
}
cc: WOString {
value = cc;
escapeHTML = NO;
}
hasNewsGroups: WOConditional {
condition = hasNewsGroups;
}
newsgroups: WOString {
value = newsgroups;
escapeHTML = NO;
}
hasReferences: WOConditional {
condition = hasReferences;
}
references: WOString {
value = references;
escapeHTML = NO;
}
messageBody: WOString {
value = messageBody;
escapeHTML = NO;