mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-20 06:03:20 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user