From f0b3c14386221e0d348bbfc25fa4c086aefe553d Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 22 Aug 2007 15:14:06 +0000 Subject: [PATCH] Monotone-Parent: d0218fb78b87e5da11e31cb28a9ec3563699c62c Monotone-Revision: 5efb21ecdb824936262ea685cfa5c21f94b0a7a3 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-08-22T15:14:06 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 5 +++++ SoObjects/Mailer/SOGoMailObject+Draft.h | 1 + SoObjects/Mailer/SOGoMailObject+Draft.m | 21 +++++++++++++++++++++ 3 files changed, 27 insertions(+) diff --git a/ChangeLog b/ChangeLog index 91a2e9292..b7849ff96 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2007-08-22 Wolfgang Sourdeau + * SoObjects/Mailer/SOGoMailObject+Draft.m ([SOGoMailObject + -contentForInlineForward]): new method that returns the content of + the message for inline forwarding based on the SOGoMailForward + templates. + * SoObjects/Mailer/SOGoDraftObject.m ([SOGoDraftObject -fetchMailForForwarding:sourceMail]): check the user preference for message forwarding and compose inline forwarded messages if required. diff --git a/SoObjects/Mailer/SOGoMailObject+Draft.h b/SoObjects/Mailer/SOGoMailObject+Draft.h index ddc534adc..706e1ca80 100644 --- a/SoObjects/Mailer/SOGoMailObject+Draft.h +++ b/SoObjects/Mailer/SOGoMailObject+Draft.h @@ -35,6 +35,7 @@ - (NSString *) subjectForForward; - (NSString *) filenameForForward; +- (NSString *) contentForInlineForward; @end diff --git a/SoObjects/Mailer/SOGoMailObject+Draft.m b/SoObjects/Mailer/SOGoMailObject+Draft.m index 12e9341b6..18e6e0f2f 100644 --- a/SoObjects/Mailer/SOGoMailObject+Draft.m +++ b/SoObjects/Mailer/SOGoMailObject+Draft.m @@ -22,9 +22,14 @@ #import +#import +#import #import #import +#import + +#import "SOGoMailForward.h" #import "SOGoMailObject+Draft.h" #define maxFilenameLength 64 @@ -207,6 +212,22 @@ return newSubject; } +- (NSString *) contentForInlineForward +{ + SOGoUser *currentUser; + NSString *pageName; + SOGoMailForward *page; + + currentUser = [context activeUser]; + pageName = [NSString stringWithFormat: @"SOGoMail%@Forward", + [currentUser language]]; + page = [[WOApplication application] pageWithName: pageName + inContext: context]; + [page setForwardedMail: self]; + + return [[page generateResponse] contentAsString]; +} + - (void) _fetchFileAttachmentKey: (NSDictionary *) part intoArray: (NSMutableArray *) keys withPath: (NSString *) path