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