See ChangeLog

Monotone-Parent: 043af14fd2ae984a7c53179d03394ad062129d22
Monotone-Revision: 32554661a85cc9243d30ced4dbf571eab59b4ea3

Monotone-Author: crobert@inverse.ca
Monotone-Date: 2008-10-03T19:01:29
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
C Robert
2008-10-03 19:01:29 +00:00
parent 95f54c2c96
commit 95c83d64e7
7 changed files with 193 additions and 86 deletions
+49
View File
@@ -397,6 +397,55 @@ static NSString *spoolFolder = nil;
return response;
}
- (WOResponse *) copyUIDs: (NSArray *) uids
toFolder: (NSString *) destinationFolder
inContext: (id) localContext
{
NSEnumerator *folders;
NSString *currentFolderName;
NSMutableString *imapDestinationFolder;
NGImap4Client *client;
id result;
imapDestinationFolder = [NSMutableString string];
folders = [[destinationFolder componentsSeparatedByString: @"/"] objectEnumerator];
currentFolderName = [folders nextObject];
while (currentFolderName)
{
if ([currentFolderName hasPrefix: @"folder"])
{
[imapDestinationFolder appendString: @"/"];
[imapDestinationFolder appendString: [currentFolderName substringFromIndex: 6]];
}
currentFolderName = [folders nextObject];
}
client = [[self imap4Connection] client];
[imap4 selectFolder: [self imap4URL]];
result = [client copyUids: uids toFolder: imapDestinationFolder];
if ([[result valueForKey: @"result"] boolValue])
result = nil;
else
result = [NSException exceptionWithHTTPStatus: 500 reason: @"Couldn't copy UIDs."];
return result;
}
- (WOResponse *) moveUIDs: (NSArray *) uids
toFolder: (NSString *) destinationFolder
inContext: (id) localContext
{
id result;
result = [self copyUIDs: uids toFolder: destinationFolder inContext: localContext];
if ( ![result isNotNull] )
result = [self deleteUIDs: uids inContext: localContext];
return result;
}
- (NSArray *) fetchUIDsMatchingQualifier: (id) _q
sortOrdering: (id) _so
{