diff --git a/ChangeLog b/ChangeLog index 507ebc6f6..93967c46b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2008-09-05 Wolfgang Sourdeau + * 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. diff --git a/SoObjects/Mailer/NSData+Mail.m b/SoObjects/Mailer/NSData+Mail.m index 09af5b918..22e398414 100644 --- a/SoObjects/Mailer/NSData+Mail.m +++ b/SoObjects/Mailer/NSData+Mail.m @@ -25,6 +25,7 @@ #import #import +#import #import "NSData+Mail.h" diff --git a/SoObjects/Mailer/SOGoMailDutchReply.wo/SOGoMailDutchReply.html b/SoObjects/Mailer/SOGoMailDutchReply.wo/SOGoMailDutchReply.html index 0ccbf4549..7d34187be 100644 --- a/SoObjects/Mailer/SOGoMailDutchReply.wo/SOGoMailDutchReply.html +++ b/SoObjects/Mailer/SOGoMailDutchReply.wo/SOGoMailDutchReply.html @@ -1,4 +1,10 @@ -On <#date/>, <#from/> wrote: +<#outlookMode>-------- Original Message -------- +Subject: <#subject/> +Date: <#date/> +From: <#from/> +<#hasReplyTo>Reply-To: <#replyTo/><#hasOrganization>Organization: <#organization/>To: <#to/> +<#hasCc>CC: <#cc/><#hasNewsGroups>Newsgroups: <#newsgroups/><#hasReferences>References: <#references/> +<#standardMode>On <#date/>, <#from/> wrote: <#messageBody/> diff --git a/SoObjects/Mailer/SOGoMailDutchReply.wo/SOGoMailDutchReply.wod b/SoObjects/Mailer/SOGoMailDutchReply.wo/SOGoMailDutchReply.wod index 7a66a17bf..0df01066f 100644 --- a/SoObjects/Mailer/SOGoMailDutchReply.wo/SOGoMailDutchReply.wod +++ b/SoObjects/Mailer/SOGoMailDutchReply.wo/SOGoMailDutchReply.wod @@ -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; diff --git a/SoObjects/Mailer/SOGoMailEnglishReply.wo/SOGoMailEnglishReply.html b/SoObjects/Mailer/SOGoMailEnglishReply.wo/SOGoMailEnglishReply.html index 0ccbf4549..7d34187be 100644 --- a/SoObjects/Mailer/SOGoMailEnglishReply.wo/SOGoMailEnglishReply.html +++ b/SoObjects/Mailer/SOGoMailEnglishReply.wo/SOGoMailEnglishReply.html @@ -1,4 +1,10 @@ -On <#date/>, <#from/> wrote: +<#outlookMode>-------- Original Message -------- +Subject: <#subject/> +Date: <#date/> +From: <#from/> +<#hasReplyTo>Reply-To: <#replyTo/><#hasOrganization>Organization: <#organization/>To: <#to/> +<#hasCc>CC: <#cc/><#hasNewsGroups>Newsgroups: <#newsgroups/><#hasReferences>References: <#references/> +<#standardMode>On <#date/>, <#from/> wrote: <#messageBody/> diff --git a/SoObjects/Mailer/SOGoMailEnglishReply.wo/SOGoMailEnglishReply.wod b/SoObjects/Mailer/SOGoMailEnglishReply.wo/SOGoMailEnglishReply.wod index 7a66a17bf..0df01066f 100644 --- a/SoObjects/Mailer/SOGoMailEnglishReply.wo/SOGoMailEnglishReply.wod +++ b/SoObjects/Mailer/SOGoMailEnglishReply.wo/SOGoMailEnglishReply.wod @@ -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; diff --git a/SoObjects/Mailer/SOGoMailForward.h b/SoObjects/Mailer/SOGoMailForward.h index e20fa5d6e..e0273f980 100644 --- a/SoObjects/Mailer/SOGoMailForward.h +++ b/SoObjects/Mailer/SOGoMailForward.h @@ -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 */ diff --git a/SoObjects/Mailer/SOGoMailForward.m b/SoObjects/Mailer/SOGoMailForward.m index 49165bb64..5be3283d0 100644 --- a/SoObjects/Mailer/SOGoMailForward.m +++ b/SoObjects/Mailer/SOGoMailForward.m @@ -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 diff --git a/SoObjects/Mailer/SOGoMailFrenchReply.wo/SOGoMailFrenchReply.html b/SoObjects/Mailer/SOGoMailFrenchReply.wo/SOGoMailFrenchReply.html index d7f225103..fde14162e 100644 --- a/SoObjects/Mailer/SOGoMailFrenchReply.wo/SOGoMailFrenchReply.html +++ b/SoObjects/Mailer/SOGoMailFrenchReply.wo/SOGoMailFrenchReply.html @@ -1,4 +1,10 @@ -Le <#date/>, <#from/> a écrit: +<#outlookMode>-------- Original Message -------- +Subject: <#subject/> +Date: <#date/> +From: <#from/> +<#hasReplyTo>Reply-To: <#replyTo/><#hasOrganization>Organization: <#organization/>To: <#to/> +<#hasCc>CC: <#cc/><#hasNewsGroups>Newsgroups: <#newsgroups/><#hasReferences>References: <#references/> +<#standardMode>Le <#date/>, <#from/> a écrit: <#messageBody/> diff --git a/SoObjects/Mailer/SOGoMailFrenchReply.wo/SOGoMailFrenchReply.wod b/SoObjects/Mailer/SOGoMailFrenchReply.wo/SOGoMailFrenchReply.wod index 7a66a17bf..0df01066f 100644 --- a/SoObjects/Mailer/SOGoMailFrenchReply.wo/SOGoMailFrenchReply.wod +++ b/SoObjects/Mailer/SOGoMailFrenchReply.wo/SOGoMailFrenchReply.wod @@ -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; diff --git a/SoObjects/Mailer/SOGoMailGermanReply.wo/SOGoMailGermanReply.html b/SoObjects/Mailer/SOGoMailGermanReply.wo/SOGoMailGermanReply.html index 0ccbf4549..7d34187be 100644 --- a/SoObjects/Mailer/SOGoMailGermanReply.wo/SOGoMailGermanReply.html +++ b/SoObjects/Mailer/SOGoMailGermanReply.wo/SOGoMailGermanReply.html @@ -1,4 +1,10 @@ -On <#date/>, <#from/> wrote: +<#outlookMode>-------- Original Message -------- +Subject: <#subject/> +Date: <#date/> +From: <#from/> +<#hasReplyTo>Reply-To: <#replyTo/><#hasOrganization>Organization: <#organization/>To: <#to/> +<#hasCc>CC: <#cc/><#hasNewsGroups>Newsgroups: <#newsgroups/><#hasReferences>References: <#references/> +<#standardMode>On <#date/>, <#from/> wrote: <#messageBody/> diff --git a/SoObjects/Mailer/SOGoMailGermanReply.wo/SOGoMailGermanReply.wod b/SoObjects/Mailer/SOGoMailGermanReply.wo/SOGoMailGermanReply.wod index 7a66a17bf..0df01066f 100644 --- a/SoObjects/Mailer/SOGoMailGermanReply.wo/SOGoMailGermanReply.wod +++ b/SoObjects/Mailer/SOGoMailGermanReply.wo/SOGoMailGermanReply.wod @@ -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; diff --git a/SoObjects/Mailer/SOGoMailItalianReply.wo/SOGoMailItalianReply.html b/SoObjects/Mailer/SOGoMailItalianReply.wo/SOGoMailItalianReply.html index 49a2ddac8..4fd9951ee 100644 --- a/SoObjects/Mailer/SOGoMailItalianReply.wo/SOGoMailItalianReply.html +++ b/SoObjects/Mailer/SOGoMailItalianReply.wo/SOGoMailItalianReply.html @@ -1,4 +1,10 @@ -Il giorno <#date/>, <#from/> ha scritto: +<#outlookMode>-------- Original Message -------- +Subject: <#subject/> +Date: <#date/> +From: <#from/> +<#hasReplyTo>Reply-To: <#replyTo/><#hasOrganization>Organization: <#organization/>To: <#to/> +<#hasCc>CC: <#cc/><#hasNewsGroups>Newsgroups: <#newsgroups/><#hasReferences>References: <#references/> +<#standardMode>Il giorno <#date/>, <#from/> ha scritto: <#messageBody/> diff --git a/SoObjects/Mailer/SOGoMailItalianReply.wo/SOGoMailItalianReply.wod b/SoObjects/Mailer/SOGoMailItalianReply.wo/SOGoMailItalianReply.wod index 0e212a785..0df01066f 100644 --- a/SoObjects/Mailer/SOGoMailItalianReply.wo/SOGoMailItalianReply.wod +++ b/SoObjects/Mailer/SOGoMailItalianReply.wo/SOGoMailItalianReply.wod @@ -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; diff --git a/SoObjects/Mailer/SOGoMailObject+Draft.m b/SoObjects/Mailer/SOGoMailObject+Draft.m index 0df47ec54..a962df870 100644 --- a/SoObjects/Mailer/SOGoMailObject+Draft.m +++ b/SoObjects/Mailer/SOGoMailObject+Draft.m @@ -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]; } diff --git a/SoObjects/Mailer/SOGoMailReply.h b/SoObjects/Mailer/SOGoMailReply.h index 421fcc701..118179edc 100644 --- a/SoObjects/Mailer/SOGoMailReply.h +++ b/SoObjects/Mailer/SOGoMailReply.h @@ -23,21 +23,23 @@ #ifndef SOGOMAILREPLY_H #define SOGOMAILREPLY_H -#import +#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 */ diff --git a/SoObjects/Mailer/SOGoMailReply.m b/SoObjects/Mailer/SOGoMailReply.m index c2294c08b..5006094ad 100644 --- a/SoObjects/Mailer/SOGoMailReply.m +++ b/SoObjects/Mailer/SOGoMailReply.m @@ -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 diff --git a/SoObjects/Mailer/SOGoMailSpanishReply.wo/SOGoMailSpanishReply.html b/SoObjects/Mailer/SOGoMailSpanishReply.wo/SOGoMailSpanishReply.html index 0ccbf4549..7d34187be 100644 --- a/SoObjects/Mailer/SOGoMailSpanishReply.wo/SOGoMailSpanishReply.html +++ b/SoObjects/Mailer/SOGoMailSpanishReply.wo/SOGoMailSpanishReply.html @@ -1,4 +1,10 @@ -On <#date/>, <#from/> wrote: +<#outlookMode>-------- Original Message -------- +Subject: <#subject/> +Date: <#date/> +From: <#from/> +<#hasReplyTo>Reply-To: <#replyTo/><#hasOrganization>Organization: <#organization/>To: <#to/> +<#hasCc>CC: <#cc/><#hasNewsGroups>Newsgroups: <#newsgroups/><#hasReferences>References: <#references/> +<#standardMode>On <#date/>, <#from/> wrote: <#messageBody/> diff --git a/SoObjects/Mailer/SOGoMailSpanishReply.wo/SOGoMailSpanishReply.wod b/SoObjects/Mailer/SOGoMailSpanishReply.wo/SOGoMailSpanishReply.wod index 7a66a17bf..0df01066f 100644 --- a/SoObjects/Mailer/SOGoMailSpanishReply.wo/SOGoMailSpanishReply.wod +++ b/SoObjects/Mailer/SOGoMailSpanishReply.wo/SOGoMailSpanishReply.wod @@ -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;