diff --git a/ChangeLog b/ChangeLog index b34cb1e98..fd7996ea1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-02-07 Ludovic Marcotte + + * OpenChange/MAPIStoreDeletedItemsContext.m: now a subclass of + MAPIStoreMailContext and make use of the trash folder as module + folder. + 2011-02-06 Wolfgang Sourdeau * OpenChange/MAPIStoreMailMessageTable.m (-setSordOrder): diff --git a/OpenChange/MAPIStoreDeletedItemsContext.h b/OpenChange/MAPIStoreDeletedItemsContext.h index d4cc79f31..01e265e15 100644 --- a/OpenChange/MAPIStoreDeletedItemsContext.h +++ b/OpenChange/MAPIStoreDeletedItemsContext.h @@ -23,9 +23,9 @@ #ifndef MAPISTOREDELETEDITEMSCONTEXT_H #define MAPISTOREDELETEDITEMSCONTEXT_H -#import "MAPIStoreFSBaseContext.h" +#import "MAPIStoreMailContext.h" -@interface MAPIStoreDeletedItemsContext : MAPIStoreFSBaseContext +@interface MAPIStoreDeletedItemsContext : MAPIStoreMailContext @end diff --git a/OpenChange/MAPIStoreDeletedItemsContext.m b/OpenChange/MAPIStoreDeletedItemsContext.m index 5cc4263c9..493a91ed9 100644 --- a/OpenChange/MAPIStoreDeletedItemsContext.m +++ b/OpenChange/MAPIStoreDeletedItemsContext.m @@ -22,8 +22,15 @@ #import +#import + #import "MAPIStoreMapping.h" +#import + +#import "MAPIApplication.h" +#import "MAPIStoreAuthenticator.h" + #import "MAPIStoreDeletedItemsContext.h" @implementation MAPIStoreDeletedItemsContext @@ -39,4 +46,40 @@ withID: 0x170001]; } +- (void) setupModuleFolder +{ + SOGoUserFolder *userFolder; + SOGoMailAccounts *accountsFolder; + SOGoMailAccount *accountFolder; + SOGoFolder *currentContainer; + + userFolder = [SOGoUserFolder objectWithName: [authenticator username] + inContainer: MAPIApp]; + [parentFoldersBag addObject: userFolder]; + // [self logWithFormat: @"userFolder: %@", userFolder]; + [woContext setClientObject: userFolder]; + + accountsFolder = [userFolder lookupName: @"Mail" + inContext: woContext + acquire: NO]; + [parentFoldersBag addObject: accountsFolder]; + // [self logWithFormat: @"accountsFolder: %@", accountsFolder]; + [woContext setClientObject: accountsFolder]; + + accountFolder = [accountsFolder lookupName: @"0" + inContext: woContext + acquire: NO]; + [parentFoldersBag addObject: accountFolder]; + [woContext setClientObject: accountFolder]; + + moduleFolder = [accountFolder trashFolderInContext: nil]; + [moduleFolder retain]; + currentContainer = [moduleFolder container]; + while (currentContainer != (SOGoFolder *) accountFolder) + { + [parentFoldersBag addObject: currentContainer]; + currentContainer = [currentContainer container]; + } +} + @end