Monotone-Parent: cc054885aad697b7949d4593db97e45d30d2e276

Monotone-Revision: 7abad0bacab329e28e1ff4cdfbdc624f171b7132

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-08-18T20:37:18
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2007-08-18 20:37:18 +00:00
parent 95566592e5
commit 4292a8bf50
3 changed files with 62 additions and 0 deletions
+45
View File
@@ -22,6 +22,9 @@
#import <Foundation/NSString.h>
#import <NGObjWeb/WOContext.h>
#import <NGObjWeb/WORequest.h>
#import <NGObjWeb/WOResponse.h>
#import <SoObjects/Mailer/SOGoDraftObject.h>
#import <SoObjects/Mailer/SOGoDraftsFolder.h>
#import <SoObjects/Mailer/SOGoMailAccount.h>
@@ -104,4 +107,46 @@
return [self redirectToLocation: newLocation];
}
/* SOGoDraftObject */
- (id) deleteAction
{
SOGoDraftObject *draft;
NSException *error;
id response;
draft = [self clientObject];
error = [draft delete];
if (error)
response = error;
else
{
response = [context response];
[response setStatus: 204];
}
return response;
}
- (WOResponse *) deleteAttachmentAction
{
WOResponse *response;
NSString *filename;
response = [context response];
filename = [[context request] formValueForKey: @"filename"];
if ([filename length] > 0)
{
[[self clientObject] deleteAttachmentWithName: filename];
[response setStatus: 204];
}
else
{
[response setStatus: 500];
[response appendContentString: @"How did you end up here?"];
}
return response;
}
@end