From 4c17603ab514e2234b4afa2ad771dd455a8e5b4c Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 5 Sep 2008 15:07:24 +0000 Subject: [PATCH] Monotone-Parent: d0dc408cde2d2c26295711b91f59760222260c54 Monotone-Revision: 58118872a67f2415e728d474867cd19b9aa6f393 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-09-05T15:07:24 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 +++ SoObjects/Mailer/SOGoMailObject+Draft.m | 36 +++++++++++++++++++------ 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8298567b4..8d667f4b0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2008-09-05 Wolfgang Sourdeau + * SoObjects/Mailer/SOGoMailObject+Draft.m ([SOGoMailObject + -contentForReply]): if the reply style is outlook, then we use the + content generated for inline forwarding. + * SoObjects/Mailer/SOGoMailFolder.m ([SOGoMailFolder -expungeLastMarkedFolder]): do not perform the expunge if the marked folder is the current folder. diff --git a/SoObjects/Mailer/SOGoMailObject+Draft.m b/SoObjects/Mailer/SOGoMailObject+Draft.m index d733187e2..3983977fd 100644 --- a/SoObjects/Mailer/SOGoMailObject+Draft.m +++ b/SoObjects/Mailer/SOGoMailObject+Draft.m @@ -40,8 +40,22 @@ #define maxFilenameLength 64 +static BOOL inited = NO; +static BOOL useOutlookStyleReplies = NO; + @implementation SOGoMailObject (SOGoDraftObjectExtensions) ++ (void) initialize +{ + NSUserDefaults *ud; + + if (!inited) + { + ud = [NSUserDefaults standardUserDefaults]; + useOutlookStyleReplies = [ud boolForKey: @"SOGoMailUseOutlookStyleReplies"]; + } +} + - (NSString *) subjectForReply { static NSString *replyPrefixes[] = { @@ -132,17 +146,23 @@ - (NSString *) contentForReply { SOGoUser *currentUser; - NSString *pageName; + NSString *pageName, *content; SOGoMailReply *page; - currentUser = [context activeUser]; - pageName = [NSString stringWithFormat: @"SOGoMail%@Reply", - [currentUser language]]; - page = [[WOApplication application] pageWithName: pageName - inContext: context]; - [page setRepliedMail: self]; + if (useOutlookStyleReplies) + content = [self contentForInlineForward]; + else + { + currentUser = [context activeUser]; + pageName = [NSString stringWithFormat: @"SOGoMail%@Reply", + [currentUser language]]; + page = [[WOApplication application] pageWithName: pageName + inContext: context]; + [page setRepliedMail: self]; + content = [[page generateResponse] contentAsString]; + } - return [[page generateResponse] contentAsString]; + return content; } - (NSString *) filenameForForward