mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-03 02:25:25 +00:00
Monotone-Parent: 3dc6d9dff558dfb935fde8eee2c978d9a9d1a774
Monotone-Revision: e89a46b719b80b6d34d9e7a110754e60344dd669 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-01-26T19:54:36 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -24,9 +24,13 @@
|
||||
|
||||
#import "MAPIStoreMailFolder.h"
|
||||
#import "MAPIStoreMapping.h"
|
||||
#import "NSString+MAPIStore.h"
|
||||
|
||||
#import "MAPIStoreMailContext.h"
|
||||
|
||||
#undef DEBUG
|
||||
#include <mapistore/mapistore.h>
|
||||
|
||||
@implementation MAPIStoreMailContext
|
||||
|
||||
+ (NSString *) MAPIModuleName
|
||||
@@ -34,6 +38,11 @@
|
||||
return nil;
|
||||
}
|
||||
|
||||
+ (enum mapistore_context_role) contextRole
|
||||
{
|
||||
return MAPISTORE_MAIL_ROLE;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation MAPIStoreInboxContext
|
||||
@@ -43,6 +52,24 @@
|
||||
return @"inbox";
|
||||
}
|
||||
|
||||
+ (struct mapistore_contexts_list *) listContextsForUser: (NSString *) userName
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
struct mapistore_contexts_list *context;
|
||||
NSString *url;
|
||||
|
||||
context = talloc_zero(memCtx, struct mapistore_contexts_list);
|
||||
url = [NSString stringWithFormat: @"sogo://%@:%@@%@/", userName, userName, [self MAPIModuleName]];
|
||||
context->url = [url asUnicodeInMemCtx: context];
|
||||
// context->name = "Inbox";
|
||||
context->main_folder = true;
|
||||
context->role = [self contextRole];
|
||||
context->tag = "tag";
|
||||
context->prev = context;
|
||||
|
||||
return context;
|
||||
}
|
||||
|
||||
- (void) setupBaseFolder: (NSURL *) newURL
|
||||
{
|
||||
baseFolder = [MAPIStoreInboxFolder baseFolderWithURL: newURL
|
||||
@@ -59,6 +86,11 @@
|
||||
return @"sent-items";
|
||||
}
|
||||
|
||||
+ (enum mapistore_context_role) contextRole
|
||||
{
|
||||
return MAPISTORE_SENTITEMS_ROLE;
|
||||
}
|
||||
|
||||
- (void) setupBaseFolder: (NSURL *) newURL
|
||||
{
|
||||
baseFolder = [MAPIStoreSentItemsFolder baseFolderWithURL: newURL
|
||||
@@ -75,6 +107,11 @@
|
||||
return @"drafts";
|
||||
}
|
||||
|
||||
+ (enum mapistore_context_role) contextRole
|
||||
{
|
||||
return MAPISTORE_DRAFTS_ROLE;
|
||||
}
|
||||
|
||||
- (void) setupBaseFolder: (NSURL *) newURL
|
||||
{
|
||||
baseFolder = [MAPIStoreDraftsFolder baseFolderWithURL: newURL
|
||||
@@ -93,6 +130,11 @@
|
||||
return @"deleted-items";
|
||||
}
|
||||
|
||||
+ (enum mapistore_context_role) contextRole
|
||||
{
|
||||
return MAPISTORE_DELETEDITEMS_ROLE;
|
||||
}
|
||||
|
||||
- (void) setupBaseFolder: (NSURL *) newURL
|
||||
{
|
||||
baseFolder = [MAPIStoreFSFolder baseFolderWithURL: newURL inContext: self];
|
||||
@@ -115,6 +157,11 @@
|
||||
return @"outbox";
|
||||
}
|
||||
|
||||
+ (enum mapistore_context_role) contextRole
|
||||
{
|
||||
return MAPISTORE_OUTBOX_ROLE;
|
||||
}
|
||||
|
||||
- (void) setupBaseFolder: (NSURL *) newURL
|
||||
{
|
||||
baseFolder = [MAPIStoreOutboxFolder baseFolderWithURL: newURL
|
||||
|
||||
Reference in New Issue
Block a user