2010-12-13 17:46:09 +01:00
|
|
|
/* MAPIStoreNotesContext.m - this file is part of SOGo
|
|
|
|
*
|
2012-08-17 21:04:57 +02:00
|
|
|
* Copyright (C) 2010-2012 Inverse inc.
|
2016-06-23 14:58:25 +02:00
|
|
|
* Copyright (C) 2016 Enrique J. Hernandez
|
2010-12-13 17:46:09 +01:00
|
|
|
*
|
|
|
|
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
|
|
|
*
|
|
|
|
* This file is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 3, or (at your option)
|
|
|
|
* any later version.
|
|
|
|
*
|
|
|
|
* This file is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; see the file COPYING. If not, write to
|
|
|
|
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2016-02-17 16:09:18 +01:00
|
|
|
#import <Foundation/NSString.h>
|
2010-12-13 17:46:09 +01:00
|
|
|
|
2016-02-17 16:09:18 +01:00
|
|
|
#import "MAPIStoreNotesFolder.h"
|
|
|
|
#import "MAPIStoreMapping.h"
|
2010-12-13 17:46:09 +01:00
|
|
|
|
2016-02-17 16:09:18 +01:00
|
|
|
#import "MAPIStoreNotesContext.h"
|
2010-12-13 17:46:09 +01:00
|
|
|
|
2012-01-26 20:54:36 +01:00
|
|
|
#undef DEBUG
|
2016-02-17 16:09:18 +01:00
|
|
|
#include <mapistore/mapistore.h>
|
2012-01-26 20:54:36 +01:00
|
|
|
|
2016-06-23 14:58:25 +02:00
|
|
|
static Class MAPIStoreNotesFolderK;
|
|
|
|
|
2010-12-13 17:46:09 +01:00
|
|
|
@implementation MAPIStoreNotesContext
|
|
|
|
|
2016-06-23 14:58:25 +02:00
|
|
|
+ (void) initialize
|
|
|
|
{
|
|
|
|
MAPIStoreNotesFolderK = [MAPIStoreNotesFolder class];
|
|
|
|
}
|
|
|
|
|
2010-12-13 17:46:09 +01:00
|
|
|
+ (NSString *) MAPIModuleName
|
|
|
|
{
|
|
|
|
return @"notes";
|
|
|
|
}
|
|
|
|
|
2016-06-23 14:58:25 +02:00
|
|
|
+ (enum mapistore_context_role) MAPIContextRole
|
|
|
|
{
|
|
|
|
return MAPISTORE_NOTES_ROLE;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (Class) MAPIStoreFolderClass
|
|
|
|
{
|
|
|
|
return MAPIStoreNotesFolderK;
|
|
|
|
}
|
|
|
|
|
2012-01-26 20:54:36 +01:00
|
|
|
+ (struct mapistore_contexts_list *) listContextsForUser: (NSString *) userName
|
2013-11-08 17:02:50 +01:00
|
|
|
withIndexing: (struct indexing_context *) indexing
|
2012-01-26 20:54:36 +01:00
|
|
|
inMemCtx: (TALLOC_CTX *) memCtx
|
|
|
|
{
|
|
|
|
struct mapistore_contexts_list *context;
|
|
|
|
|
|
|
|
context = talloc_zero(memCtx, struct mapistore_contexts_list);
|
|
|
|
context->url = talloc_asprintf (context, "sogo://%s@notes/",
|
2015-01-19 19:04:06 +01:00
|
|
|
[[userName stringByReplacingOccurrencesOfString: @"@"
|
|
|
|
withString: @"%40"] UTF8String]);
|
2012-01-26 20:54:36 +01:00
|
|
|
// context->name = "Notes personnelles";
|
|
|
|
context->main_folder = true;
|
|
|
|
context->role = MAPISTORE_NOTES_ROLE;
|
|
|
|
context->tag = "tag";
|
|
|
|
context->prev = context;
|
|
|
|
|
|
|
|
return context;
|
|
|
|
}
|
|
|
|
|
2010-12-13 17:46:09 +01:00
|
|
|
@end
|