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:
Wolfgang Sourdeau
2008-09-22 21:31:42 +00:00
parent ffffac624a
commit 4371dba9a1
10 changed files with 107 additions and 415 deletions
+47
View File
@@ -255,6 +255,53 @@ static BOOL aclConformsToIMAPExt = NO;
}
/* messages */
- (NSException *) deleteUIDs: (NSArray *) uids
inContext: (id) localContext
{
SOGoMailFolder *trashFolder;
id result;
NSException *error;
NSString *folderName;
NGImap4Client *client;
// TODO: check for safe HTTP method
trashFolder = [[self mailAccountFolder] trashFolderInContext: localContext];
if ([trashFolder isNotNull])
{
if ([trashFolder isKindOfClass: [NSException class]])
error = (NSException *) trashFolder;
else
{
client = [[self imap4Connection] client];
folderName = [[self imap4Connection]
imap4FolderNameForURL: [trashFolder imap4URL]];
result = [client copyUids: uids toFolder: folderName];
if ([[result valueForKey: @"result"] boolValue])
{
result = [client storeFlags: [NSArray arrayWithObject: @"Deleted"]
forUIDs: uids addOrRemove: YES];
if ([[result valueForKey: @"result"] boolValue])
{
[self markForExpunge];
[trashFolder flushMailCaches];
error = nil;
}
else
error
= [NSException exceptionWithHTTPStatus:500
reason: @"Could not mark UIDs as Deleted"];
}
else
error = [NSException exceptionWithHTTPStatus:500
reason: @"Could not copy UIDs"];
}
}
else
error = [NSException exceptionWithHTTPStatus: 500
reason: @"Did not find Trash folder!"];
return error;
}
- (NSArray *) fetchUIDsMatchingQualifier: (id) _q
sortOrdering: (id) _so