From 6196370382b13b572436f48fd87e834df0a6571f Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 17 Aug 2007 02:44:19 +0000 Subject: [PATCH] Monotone-Parent: 1176a93f2b330519d72275451c25f255644728a0 Monotone-Revision: 78368bef9127d18bc7c8caa083b231e30808c0ee Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-08-17T02:44:19 Monotone-Branch: ca.inverse.sogo --- UI/MailerUI/UIxMailActions.h | 31 ++++++++++ UI/MailerUI/UIxMailActions.m | 107 +++++++++++++++++++++++++++++++++++ 2 files changed, 138 insertions(+) create mode 100644 UI/MailerUI/UIxMailActions.h create mode 100644 UI/MailerUI/UIxMailActions.m diff --git a/UI/MailerUI/UIxMailActions.h b/UI/MailerUI/UIxMailActions.h new file mode 100644 index 000000000..950639e98 --- /dev/null +++ b/UI/MailerUI/UIxMailActions.h @@ -0,0 +1,31 @@ +/* UIxMailActions.h - this file is part of SOGo + * + * Copyright (C) 2007 Inverse groupe conseil + * + * Author: Wolfgang Sourdeau + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef UIXMAILACTIONS_H +#define UIXMAILACTIONS_H + +#import + +@interface UIxMailActions : WODirectAction +@end + +#endif /* UIXMAILACTIONS_H */ diff --git a/UI/MailerUI/UIxMailActions.m b/UI/MailerUI/UIxMailActions.m new file mode 100644 index 000000000..7e177cda3 --- /dev/null +++ b/UI/MailerUI/UIxMailActions.m @@ -0,0 +1,107 @@ +/* UIxMailActions.m - this file is part of SOGo + * + * Copyright (C) 2007 Inverse groupe conseil + * + * Author: Wolfgang Sourdeau + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#import + +#import +#import +#import +#import + +#import "../Common/WODirectAction+SOGo.h" + +#import "UIxMailActions.h" + +@implementation UIxMailActions + +- (WOResponse *) editAction +{ + SOGoMailAccount *account; + SOGoMailObject *co; + SOGoDraftsFolder *folder; + SOGoDraftObject *newMail; + NSString *newLocation; + + co = [self clientObject]; + account = [co mailAccountFolder]; + folder = [account draftsFolderInContext: context]; + newMail = [folder newDraft]; + [newMail fetchMailForEditing: co]; + [newMail storeInfo]; + + newLocation = [NSString stringWithFormat: @"%@/edit", + [newMail baseURLInContext: context]]; + + return [self redirectToLocation: newLocation]; +} + +- (WOResponse *) replyToAll: (BOOL) toAll +{ + SOGoMailAccount *account; + SOGoMailObject *co; + SOGoDraftsFolder *folder; + SOGoDraftObject *newMail; + NSString *newLocation; + + co = [self clientObject]; + account = [co mailAccountFolder]; + folder = [account draftsFolderInContext: context]; + newMail = [folder newDraft]; + [newMail fetchMailForReplying: co toAll: toAll]; + + newLocation = [NSString stringWithFormat: @"%@/edit", + [newMail baseURLInContext: context]]; + + return [self redirectToLocation: newLocation]; +} + +- (WOResponse *) replyAction +{ + return [self replyToAll: NO]; +} + +- (WOResponse *) replyToAllAction +{ + return [self replyToAll: NO]; +} + +- (WOResponse *) forwardAction +{ + SOGoMailAccount *account; + SOGoMailObject *co; + SOGoDraftsFolder *folder; + SOGoDraftObject *newMail; + NSString *newLocation; + + co = [self clientObject]; + account = [co mailAccountFolder]; + folder = [account draftsFolderInContext: context]; + newMail = [folder newDraft]; + [newMail fetchMailForForwarding: co]; + + newLocation = [NSString stringWithFormat: @"%@/edit", + [newMail baseURLInContext: context]]; + + return [self redirectToLocation: newLocation]; +} + +@end