mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-09-17 11:27:59 +00:00
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:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user