Monotone-Parent: 81f6f619789306a73dc061a36ac5b92bc8ecaac6

Monotone-Revision: 64aa83e8cd0a166c047f31a255fba032c405fbf9

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2008-09-05T16:50:22
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2008-09-05 16:50:22 +00:00
parent 627c07b01f
commit 2ed91624e0
20 changed files with 475 additions and 105 deletions

View File

@ -1,18 +1,16 @@
2008-09-05 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/Mailer/SOGoMailForward.m ([SOGoMailForward -init]):
added a "replyMode" ivar, used for outlook-style replying.
([SOGoMailForward -messageBody]): if used in "reply mode", quote
the returned body.
* 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.
([SOGoMailObject -useOutlookStyleReplies]): new method that
indicates whether the ud key "SOGoMailUseOutlookStyleReplies".
([SOGoMailObject -contentForOutlookReply]): new method, derived
from -contentForInlineForward but set the forward template in
reply-mode, to get the text in quoted form.
* SoObjects/Mailer/SOGoMailFolder.m ([SOGoMailFolder
-expungeLastMarkedFolder]): do not perform the expunge if the

View File

@ -25,6 +25,7 @@
#import <NGExtensions/NGBase64Coding.h>
#import <NGExtensions/NGQuotedPrintableCoding.h>
#import <NGExtensions/NGExtensions/NSString+Encoding.h>
#import "NSData+Mail.h"

View File

@ -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/>

View File

@ -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;

View File

@ -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/>

View File

@ -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;

View File

@ -32,14 +32,15 @@
SOGoMailObject *sourceMail;
NSString *field;
NSString *currentValue;
BOOL replyMode;
}
- (void) setForwardedMail: (SOGoMailObject *) newSourceMail;
- (void) setReplyMode: (BOOL) newReplyMode;
- (void) setSourceMail: (SOGoMailObject *) newSourceMail;
@end
@interface SOGoMailDutchForward : SOGoMailForward
@end
@interface SOGoMailEnglishForward : SOGoMailForward
@end
@ -52,4 +53,7 @@
@interface SOGoMailItalianForward : SOGoMailForward
@end
@interface SOGoMailSpanishForward : SOGoMailForward
@end
#endif /* SOGOMAILFORWARD_H */

View File

@ -21,7 +21,6 @@
*/
#import <NGObjWeb/WOContext+SoObjects.h>
#import <NGExtensions/NSString+misc.h>
#import <SoObjects/SOGo/SOGoDateFormatter.h>
#import <SoObjects/SOGo/SOGoUser.h>
@ -37,7 +36,6 @@
{
sourceMail = nil;
currentValue = nil;
replyMode = NO;
}
return self;
@ -50,16 +48,11 @@
[super dealloc];
}
- (void) setForwardedMail: (SOGoMailObject *) newSourceMail
- (void) setSourceMail: (SOGoMailObject *) newSourceMail
{
ASSIGN (sourceMail, newSourceMail);
}
- (void) setReplyMode: (BOOL) newReplyMode
{
replyMode = newReplyMode;
}
- (NSString *) subject
{
return [sourceMail decodedSubject];
@ -153,15 +146,7 @@
- (NSString *) messageBody
{
NSString *messageBody;
if (replyMode)
messageBody
= [[sourceMail contentForEditing] stringByApplyingMailQuoting];
else
messageBody = [sourceMail contentForEditing];
return messageBody;
return [sourceMail contentForEditing];
}
- (NSString *) signature
@ -179,6 +164,9 @@
@end
@implementation SOGoMailDutchForward
@end
@implementation SOGoMailEnglishForward
@end
@ -191,3 +179,5 @@
@implementation SOGoMailItalianForward
@end
@implementation SOGoMailSpanishForward
@end

View File

@ -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/>

View File

@ -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;

View File

@ -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/>

View File

@ -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;

View File

@ -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/>

View File

@ -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;

View File

@ -32,7 +32,6 @@
- (NSString *) subjectForReply;
- (NSString *) contentForReply;
- (NSString *) contentForOutlookReply;
- (NSString *) subjectForForward;
- (NSString *) filenameForForward;

View File

@ -88,6 +88,7 @@
return newSubject;
}
- (NSString *) _contentForEditingFromKeys: (NSArray *) keys
{
NSArray *types;
@ -125,7 +126,7 @@
}
}
}
return content;
}
@ -146,39 +147,17 @@
- (NSString *) contentForReply
{
SOGoUser *currentUser;
NSString *pageName, *replyContent;
NSString *pageName;
SOGoMailReply *page;
if ([self useOutlookStyleReplies])
replyContent = [self contentForOutlookReply];
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;
}
- (NSString *) contentForOutlookReply
{
SOGoUser *currentUser;
NSString *pageName;
SOGoMailForward *page;
currentUser = [context activeUser];
pageName = [NSString stringWithFormat: @"SOGoMail%@Forward",
pageName = [NSString stringWithFormat: @"SOGoMail%@Reply",
[currentUser language]];
page = [[WOApplication application] pageWithName: pageName
inContext: context];
[page setForwardedMail: self];
[page setReplyMode: YES];
[page setSourceMail: self];
[page setOutlookMode: [self useOutlookStyleReplies]];
return [[page generateResponse] contentAsString];
}
@ -239,8 +218,7 @@
[currentUser language]];
page = [[WOApplication application] pageWithName: pageName
inContext: context];
[page setForwardedMail: self];
[page setReplyMode: NO];
[page setSourceMail: self];
return [[page generateResponse] contentAsString];
}

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 */

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

View File

@ -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/>

View File

@ -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;