mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-06 00:45:09 +00:00
Monotone-Parent: 6b7485d7999f592e4a4b077024f47c2323c3fdbc
Monotone-Revision: d47c52bbe608df33a336ba2d63dad8b7524aa9d7 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-09-22T21:31:42 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/* UIxMailFolderActions.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2007 Inverse groupe conseil
|
||||
* Copyright (C) 2007-2008 Inverse inc.
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
*
|
||||
@@ -185,12 +185,9 @@
|
||||
- (WOResponse *) deleteMessagesAction
|
||||
{
|
||||
SOGoMailFolder *co;
|
||||
SOGoMailObject *mail;
|
||||
WOResponse *response;
|
||||
NSArray *uids;
|
||||
NSString *value, *uid;
|
||||
NSException *error;
|
||||
unsigned int i;
|
||||
NSString *value;
|
||||
|
||||
co = [self clientObject];
|
||||
value = [[context request] formValueForKey: @"uid"];
|
||||
@@ -199,25 +196,15 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
response = [co deleteUIDs: uids inContext: context];
|
||||
if (!response)
|
||||
response = [self responseWith204];
|
||||
}
|
||||
else
|
||||
{
|
||||
response = [self responseWithStatus: 500];
|
||||
[response appendContentString: @"Missing 'uid' parameter."];
|
||||
}
|
||||
|
||||
if (response == nil)
|
||||
response = [self responseWith204];
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user