reindentation
Monotone-Parent: 215f30784ae8904703b5fa172c7a563bf8f3b464 Monotone-Revision: 2f37714ba202d0c2f6bc3c888440ea82ee601d66 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-10-01T20:35:29 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
parent
43568edc76
commit
e4b127bb53
|
@ -1,6 +1,6 @@
|
|||
/* MAPIApplication.m - this file is part of $PROJECT_NAME_HERE$
|
||||
/* MAPIApplication.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2010 Wolfgang Sourdeau
|
||||
* Copyright (C) 2010 Inverse inc.
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
*
|
||||
|
@ -35,9 +35,9 @@ MAPIApplication *MAPIApp = nil;
|
|||
|
||||
@interface UnixSignalHandler : NSObject
|
||||
|
||||
+ sharedHandler;
|
||||
+ (id) sharedHandler;
|
||||
|
||||
- (void)removeObserver:(id)observer;
|
||||
- (void) removeObserver: (id) observer;
|
||||
|
||||
@end
|
||||
|
||||
|
@ -49,7 +49,8 @@ MAPIApplication *MAPIApp = nil;
|
|||
NSUserDefaults *ud;
|
||||
SOGoSystemDefaults *sd;
|
||||
|
||||
if (!MAPIApp) {
|
||||
if (!MAPIApp)
|
||||
{
|
||||
/* Here we work around a bug in GNUstep which decodes XML user
|
||||
defaults using the system encoding rather than honouring
|
||||
the encoding specified in the file. */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* MAPIStoreAuthenticator.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2010 Wolfgang Sourdeau
|
||||
* Copyright (C) 2010 Inverse inc.
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
*
|
||||
|
|
|
@ -41,7 +41,7 @@ static Class SOGoUserFolderK;
|
|||
|
||||
+ (void) initialize
|
||||
{
|
||||
SOGoUserFolderK = [SOGoUserFolderK class];
|
||||
SOGoUserFolderK = [SOGoUserFolder class];
|
||||
}
|
||||
|
||||
- (void) setupModuleFolder
|
||||
|
@ -72,7 +72,8 @@ static Class SOGoUserFolderK;
|
|||
int rc;
|
||||
|
||||
rc = MAPI_E_SUCCESS;
|
||||
switch (proptag) {
|
||||
switch (proptag)
|
||||
{
|
||||
case PR_ICON_INDEX: // TODO
|
||||
longValue = talloc_zero(memCtx, uint32_t);
|
||||
*longValue = 0x00000400; /* see http://msdn.microsoft.com/en-us/library/cc815472.aspx */
|
||||
|
@ -134,26 +135,26 @@ static Class SOGoUserFolderK;
|
|||
withFID: fid];
|
||||
}
|
||||
|
||||
// #define PR_REPLY_TIME PROP_TAG(PT_SYSTIME , 0x0030) /* 0x00300040 */
|
||||
// #define PR_MESSAGE_FLAGS PROP_TAG(PT_LONG , 0x0e07) /* 0x0e070003 */
|
||||
// #define PR_MSG_STATUS PROP_TAG(PT_LONG , 0x0e17) /* 0x0e170003 */
|
||||
// #define PR_INTERNET_MESSAGE_ID_UNICODE PROP_TAG(PT_UNICODE , 0x1035) /* 0x1035001f */
|
||||
// #define PR_FLAG_STATUS PROP_TAG(PT_LONG , 0x1090) /* 0x10900003 */
|
||||
// #define PR_CREATION_TIME PROP_TAG(PT_SYSTIME , 0x3007) /* 0x30070040 */
|
||||
// #define PR_SEARCH_KEY PROP_TAG(PT_BINARY , 0x300b) /* 0x300b0102 */
|
||||
// #define PR_REPLY_TIME PROP_TAG(PT_SYSTIME , 0x0030) /* 0x00300040 */
|
||||
// #define PR_MESSAGE_FLAGS PROP_TAG(PT_LONG , 0x0e07) /* 0x0e070003 */
|
||||
// #define PR_MSG_STATUS PROP_TAG(PT_LONG , 0x0e17) /* 0x0e170003 */
|
||||
// #define PR_INTERNET_MESSAGE_ID_UNICODE PROP_TAG(PT_UNICODE , 0x1035) /* 0x1035001f */
|
||||
// #define PR_FLAG_STATUS PROP_TAG(PT_LONG , 0x1090) /* 0x10900003 */
|
||||
// #define PR_CREATION_TIME PROP_TAG(PT_SYSTIME , 0x3007) /* 0x30070040 */
|
||||
// #define PR_SEARCH_KEY PROP_TAG(PT_BINARY , 0x300b) /* 0x300b0102 */
|
||||
|
||||
|
||||
// #define PR_EMS_AB_INCOMING_MSG_SIZE_LIMIT PROP_TAG(PT_LONG , 0x8190) /* 0x81900003 */
|
||||
// Not found: 81930003 // ?
|
||||
// Not found: 80fa000b // ?
|
||||
// Not found: 81c4000b // ?
|
||||
// Not found: 81e7000b // ?
|
||||
// Not found: 81ee000b // ?
|
||||
// #define PR_EMS_AB_INCOMING_MSG_SIZE_LIMIT PROP_TAG(PT_LONG , 0x8190) /* 0x81900003 */
|
||||
// Not found: 81930003 // ?
|
||||
// Not found: 80fa000b // ?
|
||||
// Not found: 81c4000b // ?
|
||||
// Not found: 81e7000b // ?
|
||||
// Not found: 81ee000b // ?
|
||||
|
||||
// Not found: 81f80003 //
|
||||
// Not found: 82020102 //
|
||||
// Not found: 818b0102 //
|
||||
// Not found: 81d1001f //
|
||||
// Not found: 81f80003 //
|
||||
// Not found: 82020102 //
|
||||
// Not found: 818b0102 //
|
||||
// Not found: 81d1001f //
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ static Class SOGoUserFolderK;
|
|||
|
||||
+ (void) initialize
|
||||
{
|
||||
SOGoUserFolderK = [SOGoUserFolderK class];
|
||||
SOGoUserFolderK = [SOGoUserFolder class];
|
||||
}
|
||||
|
||||
- (void) setupModuleFolder
|
||||
|
@ -137,7 +137,8 @@ static Class SOGoUserFolderK;
|
|||
int rc;
|
||||
|
||||
rc = MAPI_E_SUCCESS;
|
||||
switch (proptag) {
|
||||
switch (proptag)
|
||||
{
|
||||
case PR_ICON_INDEX: // TODO
|
||||
longValue = talloc_zero(memCtx, uint32_t);
|
||||
*longValue = 0x00000200; /* see http://msdn.microsoft.com/en-us/library/cc815472.aspx */
|
||||
|
@ -248,17 +249,17 @@ static Class SOGoUserFolderK;
|
|||
// *data = talloc_strdup(memCtx, "[Generic and fake unicode value]");
|
||||
// break;
|
||||
|
||||
// (18:54:45) Wolfgang-: 0x80a7001f ( Business: ) -> don't ask me which "business"
|
||||
// (18:55:05) Wolfgang-: 0x809c001f ( Other: )
|
||||
// (18:55:58) Wolfgang-: 0x81b5001f: E-mail 2
|
||||
// (18:54:45) Wolfgang-: 0x80a7001f ( Business: ) -> don't ask me which "business"
|
||||
// (18:55:05) Wolfgang-: 0x809c001f ( Other: )
|
||||
// (18:55:58) Wolfgang-: 0x81b5001f: E-mail 2
|
||||
|
||||
|
||||
// #define PR_REPLY_TIME PROP_TAG(PT_SYSTIME , 0x0030) /* 0x00300040 */
|
||||
// #define PR_SENSITIVITY PROP_TAG(PT_LONG , 0x0036) /* 0x00360003 */
|
||||
// #define PR_FOLLOWUP_ICON PROP_TAG(PT_LONG , 0x1095) /* 0x10950003 */
|
||||
// #define PR_SEARCH_KEY PROP_TAG(PT_BINARY , 0x300b) /* 0x300b0102 */
|
||||
// #define PR_VIEW_STYLE PROP_TAG(PT_LONG , 0x6834) /* 0x68340003 */
|
||||
// #define PR_VD_VERSION PROP_TAG(PT_LONG , 0x7007) /* 0x70070003 */
|
||||
// #define PR_REPLY_TIME PROP_TAG(PT_SYSTIME , 0x0030) /* 0x00300040 */
|
||||
// #define PR_SENSITIVITY PROP_TAG(PT_LONG , 0x0036) /* 0x00360003 */
|
||||
// #define PR_FOLLOWUP_ICON PROP_TAG(PT_LONG , 0x1095) /* 0x10950003 */
|
||||
// #define PR_SEARCH_KEY PROP_TAG(PT_BINARY , 0x300b) /* 0x300b0102 */
|
||||
// #define PR_VIEW_STYLE PROP_TAG(PT_LONG , 0x6834) /* 0x68340003 */
|
||||
// #define PR_VD_VERSION PROP_TAG(PT_LONG , 0x7007) /* 0x70070003 */
|
||||
|
||||
default:
|
||||
rc = [super getMessageTableChildproperty: data
|
||||
|
@ -271,26 +272,27 @@ static Class SOGoUserFolderK;
|
|||
return rc;
|
||||
}
|
||||
|
||||
- (int) getFolderTableChildproperty: (void **) data
|
||||
atURL: (NSString *) childURL
|
||||
withTag: (uint32_t) proptag
|
||||
inFolder: (SOGoFolder *) folder
|
||||
withFID: (uint64_t) fid
|
||||
{
|
||||
int rc;
|
||||
// - (int) getFolderTableChildproperty: (void **) data
|
||||
// atURL: (NSString *) childURL
|
||||
// withTag: (uint32_t) proptag
|
||||
// inFolder: (SOGoFolder *) folder
|
||||
// withFID: (uint64_t) fid
|
||||
// {
|
||||
// int rc;
|
||||
|
||||
[self logWithFormat: @"XXXXX unexpected!!!!!!!!!"];
|
||||
rc = MAPI_E_SUCCESS;
|
||||
switch (proptag) {
|
||||
default:
|
||||
rc = [super getFolderTableChildproperty: data
|
||||
atURL: childURL
|
||||
withTag: proptag
|
||||
inFolder: folder
|
||||
withFID: fid];
|
||||
}
|
||||
// [self logWithFormat: @"XXXXX unexpected!!!!!!!!!"];
|
||||
// rc = MAPI_E_SUCCESS;
|
||||
// switch (proptag)
|
||||
// {
|
||||
// default:
|
||||
// rc = [super getFolderTableChildproperty: data
|
||||
// atURL: childURL
|
||||
// withTag: proptag
|
||||
// inFolder: folder
|
||||
// withFID: fid];
|
||||
// }
|
||||
|
||||
return rc;
|
||||
}
|
||||
// return rc;
|
||||
// }
|
||||
|
||||
@end
|
||||
|
|
|
@ -49,6 +49,8 @@
|
|||
NSMutableDictionary *subfolderCache;
|
||||
SOGoFolder *moduleFolder;
|
||||
void *memCtx;
|
||||
NSString *lastObjectURL;
|
||||
id lastObject;
|
||||
}
|
||||
|
||||
+ (id) contextFromURI: (const char *) newUri;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* MAPIStoreContext.m - this file is part of $PROJECT_NAME_HERE$
|
||||
/* MAPIStoreContext.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2010 Wolfgang Sourdeau
|
||||
* Copyright (C) 2010 Inverse inc.
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
*
|
||||
|
@ -53,12 +53,12 @@
|
|||
#include <mapistore/mapistore_errors.h>
|
||||
// #include <dlinklist.h>
|
||||
|
||||
// NSNullK = NSClassFromString (@"NSNull");
|
||||
// NSNullK = NSClassFromString (@"NSNull");
|
||||
|
||||
// SOGoMailAccountsK = NSClassFromString (@"SOGoMailAccounts");
|
||||
// SOGoMailAccountK = NSClassFromString (@"SOGoMailAccount");
|
||||
// SOGoMailFolderK = NSClassFromString (@"SOGoMailFolder");
|
||||
// SOGoUserFolderK = NSClassFromString (@"SOGoUserFolder");
|
||||
// SOGoMailAccountsK = NSClassFromString (@"SOGoMailAccounts");
|
||||
// SOGoMailAccountK = NSClassFromString (@"SOGoMailAccount");
|
||||
// SOGoMailFolderK = NSClassFromString (@"SOGoMailFolder");
|
||||
// SOGoUserFolderK = NSClassFromString (@"SOGoUserFolder");
|
||||
|
||||
static Class SOGoObjectK, SOGoMailAccountK, SOGoMailFolderK;
|
||||
|
||||
|
@ -84,8 +84,8 @@ static MAPIStoreMapping *mapping = nil;
|
|||
+ (void) initialize
|
||||
{
|
||||
SOGoObjectK = [SOGoObject class];
|
||||
SOGoMailAccountK = [SOGoMailAccount class];
|
||||
SOGoMailFolderK = [SOGoMailFolder class];
|
||||
SOGoMailAccountK = NSClassFromString (@"SOGoMailAccount");
|
||||
SOGoMailFolderK = NSClassFromString (@"SOGoMailFolder");
|
||||
mapping = [MAPIStoreMapping new];
|
||||
}
|
||||
|
||||
|
@ -101,24 +101,29 @@ static MAPIStoreMapping *mapping = nil;
|
|||
context = nil;
|
||||
|
||||
urlString = [NSString stringWithUTF8String: newUri];
|
||||
if (urlString) {
|
||||
if (urlString)
|
||||
{
|
||||
completeURLString = [@"sogo://" stringByAppendingString: urlString];
|
||||
baseURL = [NSURL URLWithString: completeURLString];
|
||||
if (baseURL) {
|
||||
if (baseURL)
|
||||
{
|
||||
module = [baseURL host];
|
||||
if (module) {
|
||||
if (module)
|
||||
{
|
||||
if ([module isEqualToString: @"mail"])
|
||||
contextClass = @"MAPIStoreMailContext";
|
||||
else if ([module isEqualToString: @"contacts"])
|
||||
contextClass = @"MAPIStoreContactsContext";
|
||||
else if ([module isEqualToString: @"calendar"])
|
||||
contextClass = @"MAPIStoreCalendarContext";
|
||||
else {
|
||||
else
|
||||
{
|
||||
NSLog (@"ERROR: unrecognized module name '%@'", module);
|
||||
contextClass = nil;
|
||||
}
|
||||
|
||||
if (contextClass) {
|
||||
if (contextClass)
|
||||
{
|
||||
[mapping registerURL: completeURLString];
|
||||
context = [NSClassFromString (contextClass) new];
|
||||
[context autorelease];
|
||||
|
@ -146,8 +151,8 @@ static MAPIStoreMapping *mapping = nil;
|
|||
|
||||
- (id) init
|
||||
{
|
||||
if ((self = [super init])) {
|
||||
// objectCache = [NSMutableDictionary new];
|
||||
if ((self = [super init]))
|
||||
{
|
||||
messageCache = [NSMutableDictionary new];
|
||||
subfolderCache = [NSMutableDictionary new];
|
||||
woContext = [WOContext contextWithRequest: nil];
|
||||
|
@ -164,13 +169,13 @@ static MAPIStoreMapping *mapping = nil;
|
|||
{
|
||||
[self logWithFormat: @"-dealloc"];
|
||||
|
||||
// [objectCache release];
|
||||
[messageCache release];
|
||||
[subfolderCache release];
|
||||
|
||||
[moduleFolder release];
|
||||
[woContext release];
|
||||
[authenticator release];
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
@ -212,6 +217,31 @@ static MAPIStoreMapping *mapping = nil;
|
|||
[self subclassResponsibility: _cmd];
|
||||
}
|
||||
|
||||
// - (void) _setNewLastObject: (id) newLastObject
|
||||
// {
|
||||
// id currentObject, container;
|
||||
|
||||
// if (newLastObject != lastObject)
|
||||
// {
|
||||
// currentObject = lastObject;
|
||||
// while (currentObject)
|
||||
// {
|
||||
// container = [currentObject container];
|
||||
// [currentObject release];
|
||||
// currentObject = container;
|
||||
// }
|
||||
|
||||
// currentObject = newLastObject;
|
||||
// while (currentObject)
|
||||
// {
|
||||
// [currentObject retain];
|
||||
// currentObject = [currentObject container];
|
||||
// }
|
||||
|
||||
// lastObject = newLastObject;
|
||||
// }
|
||||
// }
|
||||
|
||||
- (id) lookupObject: (NSString *) objectURLString
|
||||
{
|
||||
id object;
|
||||
|
@ -220,8 +250,6 @@ static MAPIStoreMapping *mapping = nil;
|
|||
int count, max;
|
||||
NSString *pathString, *nameInContainer;
|
||||
|
||||
// object = [objectCache objectForKey: objectURLString];
|
||||
// if (!object) {
|
||||
objectURL = [NSURL URLWithString: objectURLString];
|
||||
if (!objectURL)
|
||||
[self errorWithFormat: @"url string gave nil NSURL: '%@'", objectURLString];
|
||||
|
@ -230,13 +258,16 @@ static MAPIStoreMapping *mapping = nil;
|
|||
pathString = [objectURL path];
|
||||
if ([pathString hasPrefix: @"/"])
|
||||
pathString = [pathString substringFromIndex: 1];
|
||||
if ([pathString length] > 0) {
|
||||
if ([pathString length] > 0)
|
||||
{
|
||||
path = [pathString componentsSeparatedByString: @"/"];
|
||||
max = [path count];
|
||||
if (max > 0) {
|
||||
if (max > 0)
|
||||
{
|
||||
for (count = 0;
|
||||
object && count < max;
|
||||
count++) {
|
||||
count++)
|
||||
{
|
||||
nameInContainer = [[path objectAtIndex: count]
|
||||
stringByUnescapingURL];
|
||||
object = [object lookupName: nameInContainer
|
||||
|
@ -248,17 +279,14 @@ static MAPIStoreMapping *mapping = nil;
|
|||
object = nil;
|
||||
}
|
||||
}
|
||||
} else
|
||||
}
|
||||
else
|
||||
object = nil;
|
||||
|
||||
// [self _setNewLastObject: object];
|
||||
// ASSIGN (lastObjectURL, objectURLString);
|
||||
|
||||
[woContext setClientObject: object];
|
||||
// if (object && [object isKindOfClass: SOGoObjectK])
|
||||
// [objectCache setObject: object
|
||||
// forKey: objectURLString];
|
||||
// else {
|
||||
// object = nil;
|
||||
// [woContext setClientObject: nil];
|
||||
// }
|
||||
|
||||
return object;
|
||||
}
|
||||
|
@ -274,20 +302,22 @@ static MAPIStoreMapping *mapping = nil;
|
|||
newFolderURL = nil;
|
||||
|
||||
folderName = nil;
|
||||
for (i = 0; !folderName && i < aRow->cValues; i++) {
|
||||
if (aRow->lpProps[i].ulPropTag == PR_DISPLAY_NAME_UNICODE) {
|
||||
for (i = 0; !folderName && i < aRow->cValues; i++)
|
||||
{
|
||||
if (aRow->lpProps[i].ulPropTag == PR_DISPLAY_NAME_UNICODE)
|
||||
folderName = [NSString stringWithUTF8String: aRow->lpProps[i].value.lpszW];
|
||||
}
|
||||
else if (aRow->lpProps[i].ulPropTag == PR_DISPLAY_NAME) {
|
||||
else if (aRow->lpProps[i].ulPropTag == PR_DISPLAY_NAME)
|
||||
folderName = [NSString stringWithUTF8String: aRow->lpProps[i].value.lpszA];
|
||||
}
|
||||
}
|
||||
|
||||
if (folderName) {
|
||||
if (folderName)
|
||||
{
|
||||
parentFolder = [self lookupObject: parentFolderURL];
|
||||
if (parentFolder) {
|
||||
if (parentFolder)
|
||||
{
|
||||
if ([parentFolder isKindOfClass: SOGoMailAccountK]
|
||||
|| [parentFolder isKindOfClass: SOGoMailFolderK]) {
|
||||
|| [parentFolder isKindOfClass: SOGoMailFolderK])
|
||||
{
|
||||
nameInContainer = [NSString stringWithFormat: @"folder%@",
|
||||
[folderName asCSSIdentifier]];
|
||||
newFolder = [SOGoMailFolderK objectWithName: nameInContainer
|
||||
|
@ -309,7 +339,7 @@ static MAPIStoreMapping *mapping = nil;
|
|||
\param private_data pointer to the current sogo context
|
||||
|
||||
\return MAPISTORE_SUCCESS on success, otherwise MAPISTORE_ERROR
|
||||
*/
|
||||
*/
|
||||
|
||||
- (int) mkDir: (struct SRow *) aRow
|
||||
withFID: (uint64_t) fid
|
||||
|
@ -323,7 +353,8 @@ static MAPIStoreMapping *mapping = nil;
|
|||
folderURL = [mapping urlFromID: fid];
|
||||
if (folderURL)
|
||||
rc = MAPISTORE_ERR_EXIST;
|
||||
else {
|
||||
else
|
||||
{
|
||||
parentFolderURL = [mapping urlFromID: parentFID];
|
||||
if (!parentFolderURL)
|
||||
[self errorWithFormat: @"No url found for FID: %lld", parentFID];
|
||||
|
@ -354,7 +385,7 @@ static MAPIStoreMapping *mapping = nil;
|
|||
\param fid the FID for the folder to delete
|
||||
|
||||
\return MAPISTORE_SUCCESS on success, otherwise MAPISTORE_ERROR
|
||||
*/
|
||||
*/
|
||||
- (int) rmDirWithFID: (uint64_t) fid
|
||||
inParentFID: (uint64_t) parentFid
|
||||
{
|
||||
|
@ -372,7 +403,7 @@ static MAPIStoreMapping *mapping = nil;
|
|||
\param fid the identifier of the colder to open
|
||||
|
||||
\return MAPISTORE_SUCCESS on success, otherwise MAPISTORE_ERROR
|
||||
*/
|
||||
*/
|
||||
- (int) openDir: (uint64_t) fid
|
||||
inParentFID: (uint64_t) parentFID
|
||||
{
|
||||
|
@ -388,7 +419,7 @@ static MAPIStoreMapping *mapping = nil;
|
|||
\param private_data pointer to the current sogo context
|
||||
|
||||
\return MAPISTORE_SUCCESS on success, otherwise MAPISTORE_ERROR
|
||||
*/
|
||||
*/
|
||||
- (int) closeDir
|
||||
{
|
||||
[self logWithFormat: @"METHOD '%s' (%d)", __FUNCTION__, __LINE__];
|
||||
|
@ -402,7 +433,8 @@ static MAPIStoreMapping *mapping = nil;
|
|||
SOGoFolder *folder;
|
||||
|
||||
keys = [messageCache objectForKey: folderURL];
|
||||
if (!keys) {
|
||||
if (!keys)
|
||||
{
|
||||
folder = [self lookupObject: folderURL];
|
||||
if (folder)
|
||||
keys = [folder toOneRelationshipKeys];
|
||||
|
@ -420,9 +452,11 @@ static MAPIStoreMapping *mapping = nil;
|
|||
SOGoFolder *folder;
|
||||
|
||||
keys = [subfolderCache objectForKey: folderURL];
|
||||
if (!keys) {
|
||||
if (!keys)
|
||||
{
|
||||
folder = [self lookupObject: folderURL];
|
||||
if (folder) {
|
||||
if (folder)
|
||||
{
|
||||
keys = [folder toManyRelationshipKeys];
|
||||
if (!keys)
|
||||
keys = (NSArray *) [NSNull null];
|
||||
|
@ -441,7 +475,7 @@ static MAPIStoreMapping *mapping = nil;
|
|||
\param private_data pointer to the current sogo context
|
||||
|
||||
\return MAPISTORE_SUCCESS on success, otherwise MAPISTORE_ERROR
|
||||
*/
|
||||
*/
|
||||
- (int) readCount: (uint32_t *) rowCount
|
||||
ofTableType: (uint8_t) tableType
|
||||
inFID: (uint64_t) fid
|
||||
|
@ -456,7 +490,8 @@ static MAPIStoreMapping *mapping = nil;
|
|||
if (!url)
|
||||
[self errorWithFormat: @"No url found for FID: %lld", fid];
|
||||
|
||||
switch (tableType) {
|
||||
switch (tableType)
|
||||
{
|
||||
case MAPISTORE_FOLDER_TABLE:
|
||||
ids = [self _subfolderKeysForFolderURL: url];
|
||||
break;
|
||||
|
@ -468,7 +503,8 @@ static MAPIStoreMapping *mapping = nil;
|
|||
ids = nil;
|
||||
}
|
||||
|
||||
if ([ids isKindOfClass: [NSArray class]]) {
|
||||
if ([ids isKindOfClass: [NSArray class]])
|
||||
{
|
||||
rc = MAPI_E_SUCCESS;
|
||||
*rowCount = [ids count];
|
||||
}
|
||||
|
@ -491,20 +527,23 @@ static MAPIStoreMapping *mapping = nil;
|
|||
int rc;
|
||||
|
||||
rc = MAPI_E_SUCCESS;
|
||||
switch (proptag) {
|
||||
switch (proptag)
|
||||
{
|
||||
case PR_DISPLAY_NAME_UNICODE:
|
||||
child = [self lookupObject: childURL];
|
||||
*data = [[child displayName] asUnicodeInMemCtx: memCtx];
|
||||
break;
|
||||
default:
|
||||
if ((proptag & 0x001F) == 0x001F) {
|
||||
if ((proptag & 0x001F) == 0x001F)
|
||||
{
|
||||
stringValue = [NSString stringWithFormat: @"Unhandled unicode value: 0x%x", proptag];
|
||||
*data = [stringValue asUnicodeInMemCtx: memCtx];
|
||||
[self errorWithFormat: @"Unknown proptag (returned): %.8x for child '%@'",
|
||||
proptag, childURL];
|
||||
break;
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
[self errorWithFormat: @"Unknown proptag: %.8x for child '%@'",
|
||||
proptag, childURL];
|
||||
*data = NULL;
|
||||
|
@ -526,7 +565,8 @@ static MAPIStoreMapping *mapping = nil;
|
|||
int rc;
|
||||
|
||||
rc = MAPI_E_SUCCESS;
|
||||
switch (proptag) {
|
||||
switch (proptag)
|
||||
{
|
||||
case PR_INST_ID: // TODO: DOUBT
|
||||
llongValue = talloc_zero(memCtx, uint64_t);
|
||||
// *llongValue = 1;
|
||||
|
@ -565,11 +605,11 @@ static MAPIStoreMapping *mapping = nil;
|
|||
|
||||
/* those are queried while they really pertain to the
|
||||
addressbook module */
|
||||
// #define PR_OAB_LANGID PROP_TAG(PT_LONG , 0x6807) /* 0x68070003 */
|
||||
// #define PR_OAB_LANGID PROP_TAG(PT_LONG , 0x6807) /* 0x68070003 */
|
||||
// case PR_OAB_NAME_UNICODE:
|
||||
// case PR_OAB_CONTAINER_GUID_UNICODE:
|
||||
|
||||
// 0x68420102 PidTagScheduleInfoDelegatorWantsCopy (BOOL)
|
||||
// 0x68420102 PidTagScheduleInfoDelegatorWantsCopy (BOOL)
|
||||
|
||||
|
||||
default:
|
||||
|
@ -590,7 +630,8 @@ static MAPIStoreMapping *mapping = nil;
|
|||
NSMutableArray *newParts;
|
||||
|
||||
parts = [urlString componentsSeparatedByString: @"/"];
|
||||
if ([parts count] > 3) {
|
||||
if ([parts count] > 3)
|
||||
{
|
||||
newParts = [parts mutableCopy];
|
||||
[newParts autorelease];
|
||||
[newParts removeLastObject];
|
||||
|
@ -617,11 +658,13 @@ static MAPIStoreMapping *mapping = nil;
|
|||
NSString *parentURL;
|
||||
|
||||
rc = MAPI_E_SUCCESS;
|
||||
switch (proptag) {
|
||||
switch (proptag)
|
||||
{
|
||||
case PR_FID:
|
||||
llongValue = talloc_zero(memCtx, uint64_t);
|
||||
*llongValue = [mapping idFromURL: childURL];
|
||||
if (*llongValue == NSNotFound) {
|
||||
if (*llongValue == NSNotFound)
|
||||
{
|
||||
[mapping registerURL: childURL];
|
||||
*llongValue = [mapping idFromURL: childURL];
|
||||
}
|
||||
|
@ -630,15 +673,18 @@ static MAPIStoreMapping *mapping = nil;
|
|||
case PR_PARENT_FID:
|
||||
llongValue = talloc_zero(memCtx, uint64_t);
|
||||
parentURL = [self _parentURLFromURL: childURL];
|
||||
if (parentURL) {
|
||||
if (parentURL)
|
||||
{
|
||||
*llongValue = [mapping idFromURL: childURL];
|
||||
if (*llongValue == NSNotFound) {
|
||||
if (*llongValue == NSNotFound)
|
||||
{
|
||||
[mapping registerURL: childURL];
|
||||
*llongValue = [mapping idFromURL: childURL];
|
||||
}
|
||||
*data = llongValue;
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
*data = NULL;
|
||||
rc = MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
@ -693,9 +739,11 @@ static MAPIStoreMapping *mapping = nil;
|
|||
__FUNCTION__, __LINE__, proptag, pos, tableType, fid];
|
||||
|
||||
folderURL = [mapping urlFromID: fid];
|
||||
if (folderURL) {
|
||||
if (folderURL)
|
||||
{
|
||||
folder = [self lookupObject: folderURL];
|
||||
switch (tableType) {
|
||||
switch (tableType)
|
||||
{
|
||||
case MAPISTORE_FOLDER_TABLE:
|
||||
children = [self _subfolderKeysForFolderURL: folderURL];
|
||||
break;
|
||||
|
@ -707,12 +755,14 @@ static MAPIStoreMapping *mapping = nil;
|
|||
break;
|
||||
}
|
||||
|
||||
if ([children count] > pos) {
|
||||
if ([children count] > pos)
|
||||
{
|
||||
childName = [children objectAtIndex: pos];
|
||||
childURL = [folderURL stringByAppendingFormat: @"/%@",
|
||||
[childName stringByEscapingURL]];
|
||||
|
||||
if (tableType == MAPISTORE_FOLDER_TABLE) {
|
||||
if (tableType == MAPISTORE_FOLDER_TABLE)
|
||||
{
|
||||
[self logWithFormat: @" querying child folder at URL: %@", childURL];
|
||||
rc = [self getFolderTableChildproperty: data
|
||||
atURL: childURL
|
||||
|
@ -720,7 +770,8 @@ static MAPIStoreMapping *mapping = nil;
|
|||
inFolder: folder
|
||||
withFID: fid];
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
[self logWithFormat: @" querying child message at URL: %@", childURL];
|
||||
rc = [self getMessageTableChildproperty: data
|
||||
atURL: childURL
|
||||
|
@ -729,26 +780,27 @@ static MAPIStoreMapping *mapping = nil;
|
|||
withFID: fid];
|
||||
}
|
||||
/* Unhandled: */
|
||||
// #define PR_EXPIRY_TIME PROP_TAG(PT_SYSTIME , 0x0015) /* 0x00150040 */
|
||||
// #define PR_REPLY_TIME PROP_TAG(PT_SYSTIME , 0x0030) /* 0x00300040 */
|
||||
// #define PR_SENSITIVITY PROP_TAG(PT_LONG , 0x0036) /* 0x00360003 */
|
||||
// #define PR_MESSAGE_DELIVERY_TIME PROP_TAG(PT_SYSTIME , 0x0e06) /* 0x0e060040 */
|
||||
// #define PR_FOLLOWUP_ICON PROP_TAG(PT_LONG , 0x1095) /* 0x10950003 */
|
||||
// #define PR_ITEM_TEMPORARY_FLAGS PROP_TAG(PT_LONG , 0x1097) /* 0x10970003 */
|
||||
// #define PR_SEARCH_KEY PROP_TAG(PT_BINARY , 0x300b) /* 0x300b0102 */
|
||||
// #define PR_CONTENT_COUNT PROP_TAG(PT_LONG , 0x3602) /* 0x36020003 */
|
||||
// #define PR_CONTENT_UNREAD PROP_TAG(PT_LONG , 0x3603) /* 0x36030003 */
|
||||
// #define PR_FID PROP_TAG(PT_I8 , 0x6748) /* 0x67480014 */
|
||||
// unknown 36de0003 http://social.msdn.microsoft.com/Forums/en-US/os_exchangeprotocols/thread/17c68add-1f62-4b68-9d83-f9ec7c1c6c9b
|
||||
// unknown 819d0003
|
||||
// unknown 81f80003
|
||||
// unknown 81fa000b
|
||||
// #define PR_EXPIRY_TIME PROP_TAG(PT_SYSTIME , 0x0015) /* 0x00150040 */
|
||||
// #define PR_REPLY_TIME PROP_TAG(PT_SYSTIME , 0x0030) /* 0x00300040 */
|
||||
// #define PR_SENSITIVITY PROP_TAG(PT_LONG , 0x0036) /* 0x00360003 */
|
||||
// #define PR_MESSAGE_DELIVERY_TIME PROP_TAG(PT_SYSTIME , 0x0e06) /* 0x0e060040 */
|
||||
// #define PR_FOLLOWUP_ICON PROP_TAG(PT_LONG , 0x1095) /* 0x10950003 */
|
||||
// #define PR_ITEM_TEMPORARY_FLAGS PROP_TAG(PT_LONG , 0x1097) /* 0x10970003 */
|
||||
// #define PR_SEARCH_KEY PROP_TAG(PT_BINARY , 0x300b) /* 0x300b0102 */
|
||||
// #define PR_CONTENT_COUNT PROP_TAG(PT_LONG , 0x3602) /* 0x36020003 */
|
||||
// #define PR_CONTENT_UNREAD PROP_TAG(PT_LONG , 0x3603) /* 0x36030003 */
|
||||
// #define PR_FID PROP_TAG(PT_I8 , 0x6748) /* 0x67480014 */
|
||||
// unknown 36de0003 http://social.msdn.microsoft.com/Forums/en-US/os_exchangeprotocols/thread/17c68add-1f62-4b68-9d83-f9ec7c1c6c9b
|
||||
// unknown 819d0003
|
||||
// unknown 81f80003
|
||||
// unknown 81fa000b
|
||||
|
||||
}
|
||||
else
|
||||
rc = MAPISTORE_ERROR;
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
[self errorWithFormat: @"No url found for FID: %lld", fid];
|
||||
rc = MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
@ -798,7 +850,8 @@ static MAPIStoreMapping *mapping = nil;
|
|||
[self logWithFormat: @"METHOD '%s' (%d) -- tableType: %d, mid: %lld",
|
||||
__FUNCTION__, __LINE__, tableType, fmid];
|
||||
|
||||
switch (tableType) {
|
||||
switch (tableType)
|
||||
{
|
||||
case MAPISTORE_FOLDER:
|
||||
break;
|
||||
case MAPISTORE_MESSAGE:
|
||||
|
@ -824,7 +877,8 @@ static MAPIStoreMapping *mapping = nil;
|
|||
{
|
||||
[self logWithFormat: @"METHOD '%s' (%d)", __FUNCTION__, __LINE__];
|
||||
|
||||
switch (type) {
|
||||
switch (type)
|
||||
{
|
||||
case MAPISTORE_FOLDER:
|
||||
break;
|
||||
case MAPISTORE_MESSAGE:
|
||||
|
|
|
@ -39,11 +39,20 @@
|
|||
|
||||
static Class SOGoUserFolderK;
|
||||
|
||||
@implementation SOGoObject (LeakD)
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation MAPIStoreMailContext
|
||||
|
||||
+ (void) initialize
|
||||
{
|
||||
SOGoUserFolderK = [SOGoUserFolderK class];
|
||||
SOGoUserFolderK = [SOGoUserFolder class];
|
||||
}
|
||||
|
||||
- (void) setupModuleFolder
|
||||
|
@ -101,7 +110,8 @@ static Class SOGoUserFolderK;
|
|||
int rc;
|
||||
|
||||
rc = MAPI_E_SUCCESS;
|
||||
switch (proptag) {
|
||||
switch (proptag)
|
||||
{
|
||||
case PR_ICON_INDEX: // TODO
|
||||
longValue = talloc_zero(memCtx, uint32_t);
|
||||
*longValue = 0x00000100; /* read mail, see http://msdn.microsoft.com/en-us/library/cc815472.aspx */
|
||||
|
@ -150,12 +160,12 @@ static Class SOGoUserFolderK;
|
|||
*longValue = [[child davContentLength] intValue];
|
||||
*data = longValue;
|
||||
break;
|
||||
// #define PR_REPLY_TIME PROP_TAG(PT_SYSTIME , 0x0030) /* 0x00300040 */
|
||||
// #define PR_EXPIRY_TIME PROP_TAG(PT_SYSTIME , 0x0015) /* 0x00150040 */
|
||||
// #define PR_MESSAGE_DELIVERY_TIME PROP_TAG(PT_SYSTIME , 0x0e06) /* 0x0e060040 */
|
||||
// #define PR_FOLLOWUP_ICON PROP_TAG(PT_LONG , 0x1095) /* 0x10950003 */
|
||||
// #define PR_ITEM_TEMPORARY_FLAGS PROP_TAG(PT_LONG , 0x1097) /* 0x10970003 */
|
||||
// #define PR_SEARCH_KEY PROP_TAG(PT_BINARY , 0x300b) /* 0x300b0102 */
|
||||
// #define PR_REPLY_TIME PROP_TAG(PT_SYSTIME , 0x0030) /* 0x00300040 */
|
||||
// #define PR_EXPIRY_TIME PROP_TAG(PT_SYSTIME , 0x0015) /* 0x00150040 */
|
||||
// #define PR_MESSAGE_DELIVERY_TIME PROP_TAG(PT_SYSTIME , 0x0e06) /* 0x0e060040 */
|
||||
// #define PR_FOLLOWUP_ICON PROP_TAG(PT_LONG , 0x1095) /* 0x10950003 */
|
||||
// #define PR_ITEM_TEMPORARY_FLAGS PROP_TAG(PT_LONG , 0x1097) /* 0x10970003 */
|
||||
// #define PR_SEARCH_KEY PROP_TAG(PT_BINARY , 0x300b) /* 0x300b0102 */
|
||||
|
||||
|
||||
|
||||
|
@ -188,7 +198,8 @@ static Class SOGoUserFolderK;
|
|||
int rc;
|
||||
|
||||
rc = MAPI_E_SUCCESS;
|
||||
switch (proptag) {
|
||||
switch (proptag)
|
||||
{
|
||||
case PR_CONTENT_UNREAD:
|
||||
longValue = talloc_zero(memCtx, uint32_t);
|
||||
*longValue = 0;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* MAPIStoreMapping.m - this file is part of $PROJECT_NAME_HERE$
|
||||
/* MAPIStoreMapping.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2010 Inverse inc.
|
||||
*
|
||||
|
@ -35,7 +35,8 @@ static uint64_t idCounter = 0x200001;
|
|||
|
||||
- (id) init
|
||||
{
|
||||
if ((self = [super init])) {
|
||||
if ((self = [super init]))
|
||||
{
|
||||
mapping = [NSMutableDictionary new];
|
||||
reverseMapping = [NSMutableDictionary new];
|
||||
}
|
||||
|
@ -80,12 +81,15 @@ static uint64_t idCounter = 0x200001;
|
|||
BOOL rc;
|
||||
|
||||
idKey = [NSNumber numberWithUnsignedLongLong: idNbr];
|
||||
if ([mapping objectForKey: idKey] || [reverseMapping objectForKey: urlString]) {
|
||||
if ([mapping objectForKey: idKey]
|
||||
|| [reverseMapping objectForKey: urlString])
|
||||
{
|
||||
[self errorWithFormat: @"attempt to double register an entry ('%@', %lld)",
|
||||
urlString, idNbr];
|
||||
rc = NO;
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
[mapping setObject: urlString forKey: idKey];
|
||||
[reverseMapping setObject: idKey forKey: urlString];
|
||||
rc = YES;
|
||||
|
@ -101,8 +105,10 @@ static uint64_t idCounter = 0x200001;
|
|||
uint64_t idNbr;
|
||||
|
||||
// newID = openchangedb_get_new_folderID();
|
||||
if (![reverseMapping objectForKey: urlString]) {
|
||||
if ([urlString isEqualToString: @"sogo://openchange:openchange@mail/folderINBOX"]) {
|
||||
if (![reverseMapping objectForKey: urlString])
|
||||
{
|
||||
if ([urlString isEqualToString: @"sogo://openchange:openchange@mail/folderINBOX"])
|
||||
{
|
||||
idNbr = 0x160001;
|
||||
if (![self registerURL: urlString withID: idNbr])
|
||||
[self errorWithFormat: @"Unable to register root folder: %@",
|
||||
|
@ -112,19 +118,22 @@ static uint64_t idCounter = 0x200001;
|
|||
// idNbr = 0x140001;
|
||||
// idCounter = idNbr;
|
||||
// }
|
||||
else if ([urlString isEqualToString: @"sogo://openchange:openchange@contacts/personal"]) {
|
||||
else if ([urlString isEqualToString: @"sogo://openchange:openchange@contacts/personal"])
|
||||
{
|
||||
idNbr = 0x1a0001;
|
||||
if (![self registerURL: urlString withID: idNbr])
|
||||
[self errorWithFormat: @"Unable to register root folder: %@",
|
||||
urlString];
|
||||
}
|
||||
else if ([urlString isEqualToString: @"sogo://openchange:openchange@calendar/personal"]) {
|
||||
else if ([urlString isEqualToString: @"sogo://openchange:openchange@calendar/personal"])
|
||||
{
|
||||
idNbr = 0x190001;
|
||||
if (![self registerURL: urlString withID: idNbr])
|
||||
[self errorWithFormat: @"Unable to register root folder: %@",
|
||||
urlString];
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
idCounter += idIncrement;
|
||||
while (![self registerURL: urlString withID: idCounter])
|
||||
idCounter += idIncrement;
|
||||
|
|
|
@ -1,25 +1,27 @@
|
|||
/*
|
||||
OpenChange Storage Abstraction Layer library
|
||||
SOGo backend
|
||||
|
||||
OpenChange Project
|
||||
|
||||
Copyright (C)
|
||||
|
||||
This program 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 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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. If not, see <http://www.gnu.org/licenses/>.
|
||||
/* MAPIStoreSOGo.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2010 Inverse inc.
|
||||
*
|
||||
* 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 2, 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.
|
||||
*/
|
||||
|
||||
/* OpenChange SOGo storage backend */
|
||||
|
||||
#import <Foundation/NSAutoreleasePool.h>
|
||||
|
||||
#import "MAPIApplication.h"
|
||||
|
@ -51,7 +53,7 @@ static int sogo_init(void)
|
|||
\param mem_ctx pointer to the memory context
|
||||
\param uri pointer to the sogo path
|
||||
\param private_data pointer to the private backend context
|
||||
*/
|
||||
*/
|
||||
|
||||
static int sogo_create_context(TALLOC_CTX *mem_ctx, const char *uri, void **private_data)
|
||||
{
|
||||
|
@ -83,7 +85,7 @@ static int sogo_create_context(TALLOC_CTX *mem_ctx, const char *uri, void **priv
|
|||
\param private_data pointer to the current sogo context
|
||||
|
||||
\return MAPISTORE_SUCCESS on success, otherwise MAPISTORE_ERROR
|
||||
*/
|
||||
*/
|
||||
static int sogo_delete_context(void *private_data)
|
||||
{
|
||||
NSAutoreleasePool *pool;
|
||||
|
@ -109,7 +111,7 @@ static int sogo_delete_context(void *private_data)
|
|||
\param private_data pointer to the current sogo context
|
||||
|
||||
\return MAPISTORE_SUCCESS on success, otherwise MAPISTORE_ERROR
|
||||
*/
|
||||
*/
|
||||
static int sogo_release_record(void *private_data, uint64_t fmid, uint8_t type)
|
||||
{
|
||||
NSAutoreleasePool *pool;
|
||||
|
@ -141,7 +143,7 @@ static int sogo_release_record(void *private_data, uint64_t fmid, uint8_t type)
|
|||
\param path pointer on pointer to the path to return
|
||||
|
||||
\return MAPISTORE_SUCCESS on success, otherwise MAPISTORE error
|
||||
*/
|
||||
*/
|
||||
static int sogo_get_path(void *private_data, uint64_t fmid,
|
||||
uint8_t type, char **path)
|
||||
{
|
||||
|
@ -191,7 +193,7 @@ static int sogo_op_get_fid_by_name(void *private_data, uint64_t parent_fid, cons
|
|||
\param private_data pointer to the current sogo context
|
||||
|
||||
\return MAPISTORE_SUCCESS on success, otherwise MAPISTORE_ERROR
|
||||
*/
|
||||
*/
|
||||
static int sogo_op_mkdir(void *private_data, uint64_t parent_fid, uint64_t fid,
|
||||
struct SRow *aRow)
|
||||
{
|
||||
|
@ -223,7 +225,7 @@ static int sogo_op_mkdir(void *private_data, uint64_t parent_fid, uint64_t fid,
|
|||
\param fid the FID for the folder to delete
|
||||
|
||||
\return MAPISTORE_SUCCESS on success, otherwise MAPISTORE_ERROR
|
||||
*/
|
||||
*/
|
||||
static int sogo_op_rmdir(void *private_data, uint64_t parent_fid, uint64_t fid)
|
||||
{
|
||||
NSAutoreleasePool *pool;
|
||||
|
@ -254,7 +256,7 @@ static int sogo_op_rmdir(void *private_data, uint64_t parent_fid, uint64_t fid)
|
|||
\param fid the identifier of the colder to open
|
||||
|
||||
\return MAPISTORE_SUCCESS on success, otherwise MAPISTORE_ERROR
|
||||
*/
|
||||
*/
|
||||
static int sogo_op_opendir(void *private_data, uint64_t parent_fid, uint64_t fid)
|
||||
{
|
||||
NSAutoreleasePool *pool;
|
||||
|
@ -283,7 +285,7 @@ static int sogo_op_opendir(void *private_data, uint64_t parent_fid, uint64_t fid
|
|||
\param private_data pointer to the current sogo context
|
||||
|
||||
\return MAPISTORE_SUCCESS on success, otherwise MAPISTORE_ERROR
|
||||
*/
|
||||
*/
|
||||
static int sogo_op_closedir(void *private_data)
|
||||
{
|
||||
NSAutoreleasePool *pool;
|
||||
|
@ -312,7 +314,7 @@ static int sogo_op_closedir(void *private_data)
|
|||
\param private_data pointer to the current sogo context
|
||||
|
||||
\return MAPISTORE_SUCCESS on success, otherwise MAPISTORE_ERROR
|
||||
*/
|
||||
*/
|
||||
static int sogo_op_readdir_count(void *private_data,
|
||||
uint64_t fid,
|
||||
uint8_t table_type,
|
||||
|
@ -537,15 +539,24 @@ static int sogo_op_deletemessage(void *private_data,
|
|||
\details Entry point for mapistore SOGO backend
|
||||
|
||||
\return MAPI_E_SUCCESS on success, otherwise MAPISTORE error
|
||||
*/
|
||||
*/
|
||||
int mapistore_init_backend(void)
|
||||
{
|
||||
struct mapistore_backend backend;
|
||||
int ret;
|
||||
static BOOL registered = NO;
|
||||
|
||||
if (registered)
|
||||
{
|
||||
ret = MAPISTORE_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
registered = YES;
|
||||
|
||||
/* Fill in our name */
|
||||
backend.name = "sogo";
|
||||
backend.description = "mapistore sogo backend";
|
||||
backend.name = "SOGo";
|
||||
backend.description = "mapistore SOGo backend";
|
||||
backend.namespace = "sogo://";
|
||||
|
||||
/* Fill in all the operations */
|
||||
|
@ -575,6 +586,7 @@ int mapistore_init_backend(void)
|
|||
if (ret != MAPISTORE_SUCCESS) {
|
||||
DEBUG(0, ("Failed to register the '%s' mapistore backend!\n", backend.name));
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -38,7 +38,8 @@
|
|||
NSTimeZone *utc;
|
||||
uint64_t interval;
|
||||
|
||||
if (!refDate) {
|
||||
if (!refDate)
|
||||
{
|
||||
utc = [NSTimeZone timeZoneWithName: @"UTC"];
|
||||
refDate = [NSCalendarDate dateWithYear: 1601 month: 1 day: 1
|
||||
hour: 0 minute: 0 second: 0
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
{
|
||||
char *unicode;
|
||||
|
||||
unicode = talloc_strdup(memCtx, [self UTF8String]);
|
||||
unicode = talloc_strdup (memCtx, [self UTF8String]);
|
||||
|
||||
return unicode;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue