mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-03-27 00:52:45 +00:00
Monotone-Parent: 17790db0c2368364683e4074a491e7107c6cf071
Monotone-Revision: 96b5a2580e3b0b6ba57af91d0fed6f513f8e13f0 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-02-24T20:32:27 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -22,16 +22,9 @@
|
||||
|
||||
#import <Foundation/NSString.h>
|
||||
|
||||
#import <NGObjWeb/WOContext+SoObjects.h>
|
||||
|
||||
#import "MAPIStoreMailFolder.h"
|
||||
#import "MAPIStoreMapping.h"
|
||||
|
||||
#import <Mailer/SOGoDraftsFolder.h>
|
||||
#import <Mailer/SOGoMailAccount.h>
|
||||
|
||||
#import "MAPIApplication.h"
|
||||
#import "MAPIStoreAuthenticator.h"
|
||||
|
||||
#import "MAPIStoreDraftsContext.h"
|
||||
|
||||
@implementation MAPIStoreDraftsContext
|
||||
@@ -43,50 +36,15 @@
|
||||
|
||||
+ (void) registerFixedMappings: (MAPIStoreMapping *) mapping
|
||||
{
|
||||
[mapping registerURL: @"sogo://openchange:openchange@drafts/"
|
||||
withID: 0x1e0001];
|
||||
[mapping registerURL: @"sogo://openchange:openchange@inbox/"
|
||||
withID: 0x1e0001];
|
||||
}
|
||||
|
||||
- (void) setupModuleFolder
|
||||
- (void) setupBaseFolder: (NSURL *) newURL
|
||||
{
|
||||
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 draftsFolderInContext: nil];
|
||||
[moduleFolder retain];
|
||||
currentContainer = [moduleFolder container];
|
||||
while (currentContainer != (SOGoFolder *) accountFolder)
|
||||
{
|
||||
[parentFoldersBag addObject: currentContainer];
|
||||
currentContainer = [currentContainer container];
|
||||
}
|
||||
}
|
||||
|
||||
- (id) createMessageOfClass: (NSString *) messageClass
|
||||
inFolderAtURL: (NSString *) folderURL;
|
||||
{
|
||||
return [moduleFolder newDraft];
|
||||
baseFolder = [MAPIStoreDraftsFolder baseFolderWithURL: newURL
|
||||
inContext: self];
|
||||
[baseFolder retain];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user