Monotone-Parent: 55136d300cf8d13c53cb1e7978c4915fba81f463
Monotone-Revision: a13f784df474c62818bf303f9bee4b03e811641b

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2008-09-05T19:07:16
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2008-09-05 19:07:16 +00:00
parent ee8570423a
commit 163a60e07f
5 changed files with 92 additions and 37 deletions
+41
View File
@@ -36,6 +36,7 @@
#import <SoObjects/Mailer/SOGoMailFolder.h>
#import <SoObjects/Mailer/SOGoTrashFolder.h>
#import <SoObjects/Mailer/SOGoMailAccount.h>
#import <SoObjects/Mailer/SOGoMailObject.h>
#import <SoObjects/SOGo/NSObject+Utilities.h>
#import <SoObjects/SOGo/SOGoUser.h>
@@ -181,6 +182,46 @@
return response;
}
- (WOResponse *) deleteMessagesAction
{
SOGoMailFolder *co;
SOGoMailObject *mail;
WOResponse *response;
NSArray *uids;
NSString *value, *uid;
NSException *error;
unsigned int i;
co = [self clientObject];
value = [[context request] formValueForKey: @"uid"];
response = nil;
if ([value length] > 0)
{
uids = [value componentsSeparatedByString: @","];
for (i = 0; i < [uids count]; i++)
{
uid = [uids objectAtIndex: i];
mail = [co lookupName: uid inContext: context acquire: NO];
if (mail)
{
error = [mail trashInContext: context];
if (error)
{
response = [self responseWithStatus: 500];
[response appendContentString: [NSString stringWithFormat: @"Can't trash message %@/%@", [co nameInContainer], uid]];
break;
}
}
}
}
if (response == nil)
response = [self responseWith204];
return response;
}
- (WOResponse *) _setFolderPurpose: (NSString *) purpose
{
SOGoMailFolder *co;