Monotone-Parent: 426b535e2da36fbf5368515550e8353fd5148bc7

Monotone-Revision: 325588b39d451a573e15dab87f6ccb9fd342a2f0

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-09-10T15:08:32
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2007-09-10 15:08:32 +00:00
parent 848b3ce639
commit ab5c142dd8
6 changed files with 456 additions and 541 deletions
+60 -21
View File
@@ -25,6 +25,8 @@
#import <NGObjWeb/WOContext.h>
#import <NGObjWeb/WORequest.h>
#import <NGObjWeb/WOResponse.h>
#import <NGObjWeb/NSException+HTTP.h>
#import <SoObjects/Mailer/SOGoDraftObject.h>
#import <SoObjects/Mailer/SOGoDraftsFolder.h>
#import <SoObjects/Mailer/SOGoMailAccount.h>
@@ -36,27 +38,6 @@
@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;
@@ -107,7 +88,65 @@
return [self redirectToLocation: newLocation];
}
- (id) trashAction
{
id response;
response = [[self clientObject] trashInContext: context];
if (!response)
{
response = [context response];
[response setStatus: 204];
}
return response;
}
- (id) moveAction
{
NSString *destinationFolder;
id response;
destinationFolder = [[context request] formValueForKey: @"tofolder"];
if ([destinationFolder length] > 0)
{
response = [[self clientObject] moveToFolderNamed: destinationFolder
inContext: context];
if (!response)
{
response = [context response];
[response setStatus: 204];
}
}
else
response = [NSException exceptionWithHTTPStatus: 500 /* Server Error */
reason: @"No destination folder given"];
return response;
}
/* SOGoDraftObject */
- (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];
}
- (id) deleteAction
{
SOGoDraftObject *draft;