Monotone-Parent: 5a88c883713608f144b55bfcc8139174ad4ab129

Monotone-Revision: 9f415bbce0de3939851adeff8e3f25986b8630f7

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2012-08-09T21:35:09
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2012-08-09 21:35:09 +00:00
parent 830a3687b9
commit b13fe70beb
2 changed files with 44 additions and 1 deletions

View File

@ -1,5 +1,9 @@
2012-08-09 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* OpenChange/MAPIStoreMailFolder.m
(-moveFolderWithFID:fromFolder:withNewName:): first implementation
for IMAP folders.
* OpenChange/MAPIStoreSOGo.m (sogo_folder_move_folder)
(sogo_folder_copy_folder): new backend methods.
(sogo_folder_move_folder): do not instantiate an NSString from a

View File

@ -60,7 +60,7 @@
#import "MAPIStoreMailFolder.h"
static Class SOGoMailFolderK, MAPIStoreOutboxFolderK;
static Class SOGoMailFolderK, MAPIStoreMailFolderK, MAPIStoreOutboxFolderK;
#undef DEBUG
#include <util/attr.h>
@ -73,6 +73,7 @@ static Class SOGoMailFolderK, MAPIStoreOutboxFolderK;
+ (void) initialize
{
SOGoMailFolderK = [SOGoMailFolder class];
MAPIStoreMailFolderK = [MAPIStoreMailFolder class];
MAPIStoreOutboxFolderK = [MAPIStoreOutboxFolder class];
[MAPIStoreAppointmentWrapper class];
}
@ -1002,6 +1003,44 @@ _parseCOPYUID (NSString *line, NSArray **destUIDsP)
return MAPISTORE_SUCCESS;
}
- (enum mapistore_error) moveFolderWithFID: (uint64_t) fid
fromFolder: (MAPIStoreFolder *) sourceFolder
withNewName: (NSString *) newFolderName
{
enum mapistore_error rc;
MAPIStoreMailFolder *moveFolder;
NSURL *folderURL, *newFolderURL;
SOGoMailFolder *sogoMoveFolder;
NSException *error;
if ([sourceFolder isKindOfClass: MAPIStoreMailFolderK])
{
rc = [sourceFolder openFolder: &moveFolder withFID: fid];
if (rc == MAPISTORE_SUCCESS)
{
sogoMoveFolder = [moveFolder sogoObject];
folderURL = [sogoMoveFolder imap4URL];
if (!newFolderName)
newFolderName = [sogoMoveFolder nameInContainer];
newFolderURL = [NSURL URLWithString: newFolderName
relativeToURL: [sogoObject imap4URL]];
error = [[sogoMoveFolder imap4Connection]
moveMailboxAtURL: folderURL
toURL: newFolderURL];
if (error)
rc = MAPISTORE_ERR_DENIED;
else
rc = MAPISTORE_SUCCESS;
}
else
rc = MAPISTORE_ERR_NOT_FOUND;
}
else
rc = MAPISTORE_ERR_DENIED;
return rc;
}
- (MAPIStoreMessage *) createMessage
{
SOGoMAPIObject *childObject;