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:
Wolfgang Sourdeau
2010-10-01 20:35:29 +00:00
parent 43568edc76
commit e4b127bb53
11 changed files with 1376 additions and 1283 deletions
+124 -113
View File
@@ -39,32 +39,41 @@
static Class SOGoUserFolderK;
@implementation SOGoObject (LeakD)
- (void) dealloc
{
[super dealloc];
}
@end
@implementation MAPIStoreMailContext
+ (void) initialize
{
SOGoUserFolderK = [SOGoUserFolderK class];
SOGoUserFolderK = [SOGoUserFolder class];
}
- (void) setupModuleFolder
{
id userFolder, accountsFolder;
id userFolder, accountsFolder;
userFolder = [SOGoUserFolderK objectWithName: [authenticator username]
inContainer: MAPIApp];
[woContext setClientObject: userFolder];
[userFolder retain]; // LEAK
userFolder = [SOGoUserFolderK objectWithName: [authenticator username]
inContainer: MAPIApp];
[woContext setClientObject: userFolder];
[userFolder retain]; // LEAK
accountsFolder = [userFolder lookupName: @"Mail"
inContext: woContext
acquire: NO];
[woContext setClientObject: accountsFolder];
[accountsFolder retain]; // LEAK
accountsFolder = [userFolder lookupName: @"Mail"
inContext: woContext
acquire: NO];
[woContext setClientObject: accountsFolder];
[accountsFolder retain]; // LEAK
moduleFolder = [accountsFolder lookupName: @"0"
inContext: woContext
acquire: NO];
[moduleFolder retain];
moduleFolder = [accountsFolder lookupName: @"0"
inContext: woContext
acquire: NO];
[moduleFolder retain];
}
// - (int) getCommonTableChildproperty: (void **) data
@@ -94,88 +103,89 @@ static Class SOGoUserFolderK;
inFolder: (SOGoFolder *) folder
withFID: (uint64_t) fid
{
uint8_t *boolValue;
uint32_t *longValue;
SOGoMailObject *child;
NSCalendarDate *offsetDate;
int rc;
uint8_t *boolValue;
uint32_t *longValue;
SOGoMailObject *child;
NSCalendarDate *offsetDate;
int rc;
rc = MAPI_E_SUCCESS;
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 */
*data = longValue;
break;
case PR_SUBJECT_UNICODE:
child = [self lookupObject: childURL];
*data = [[child decodedSubject] asUnicodeInMemCtx: memCtx];
break;
case PR_MESSAGE_CLASS_UNICODE:
*data = talloc_strdup(memCtx, "IPM.Note");
break;
case PR_HASATTACH:
boolValue = talloc_zero(memCtx, uint8_t);
*boolValue = NO;
*data = boolValue;
break;
case PR_MESSAGE_DELIVERY_TIME:
child = [self lookupObject: childURL];
offsetDate = [[child date] addYear: -1 month: 0 day: 0
hour: 0 minute: 0 second: 0];
*data = [offsetDate asFileTimeInMemCtx: memCtx];
break;
// case PR_ROW_TYPE: // TODO: DOUBT
// longValue = talloc_zero(memCtx, uint32_t);
// *longValue = 1;
// *data = longValue;
// break;
case PR_FLAG_STATUS: // TODO
case PR_MSG_STATUS: // TODO
case PR_MESSAGE_FLAGS: // TODO
case PR_SENSITIVITY: // TODO
longValue = talloc_zero(memCtx, uint32_t);
*longValue = 0;
*data = longValue;
break;
case PR_IMPORTANCE:
longValue = talloc_zero(memCtx, uint32_t);
*longValue = 1;
*data = longValue;
break;
case PR_MESSAGE_SIZE: // TODO
child = [self lookupObject: childURL];
longValue = talloc_zero(memCtx, uint32_t);
/* TODO: choose another name for that method */
*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 */
rc = MAPI_E_SUCCESS;
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 */
*data = longValue;
break;
case PR_SUBJECT_UNICODE:
child = [self lookupObject: childURL];
*data = [[child decodedSubject] asUnicodeInMemCtx: memCtx];
break;
case PR_MESSAGE_CLASS_UNICODE:
*data = talloc_strdup(memCtx, "IPM.Note");
break;
case PR_HASATTACH:
boolValue = talloc_zero(memCtx, uint8_t);
*boolValue = NO;
*data = boolValue;
break;
case PR_MESSAGE_DELIVERY_TIME:
child = [self lookupObject: childURL];
offsetDate = [[child date] addYear: -1 month: 0 day: 0
hour: 0 minute: 0 second: 0];
*data = [offsetDate asFileTimeInMemCtx: memCtx];
break;
// case PR_ROW_TYPE: // TODO: DOUBT
// longValue = talloc_zero(memCtx, uint32_t);
// *longValue = 1;
// *data = longValue;
// break;
case PR_FLAG_STATUS: // TODO
case PR_MSG_STATUS: // TODO
case PR_MESSAGE_FLAGS: // TODO
case PR_SENSITIVITY: // TODO
longValue = talloc_zero(memCtx, uint32_t);
*longValue = 0;
*data = longValue;
break;
case PR_IMPORTANCE:
longValue = talloc_zero(memCtx, uint32_t);
*longValue = 1;
*data = longValue;
break;
case PR_MESSAGE_SIZE: // TODO
child = [self lookupObject: childURL];
longValue = talloc_zero(memCtx, uint32_t);
/* TODO: choose another name for that method */
*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 */
case PR_SENT_REPRESENTING_NAME_UNICODE:
child = [self lookupObject: childURL];
*data = [[child from] asUnicodeInMemCtx: memCtx];
break;
case PR_INTERNET_MESSAGE_ID_UNICODE:
child = [self lookupObject: childURL];
*data = [[child messageId] asUnicodeInMemCtx: memCtx];
break;
default:
rc = [super getMessageTableChildproperty: data
atURL: childURL
withTag: proptag
inFolder: folder
withFID: fid];
}
case PR_SENT_REPRESENTING_NAME_UNICODE:
child = [self lookupObject: childURL];
*data = [[child from] asUnicodeInMemCtx: memCtx];
break;
case PR_INTERNET_MESSAGE_ID_UNICODE:
child = [self lookupObject: childURL];
*data = [[child messageId] asUnicodeInMemCtx: memCtx];
break;
default:
rc = [super getMessageTableChildproperty: data
atURL: childURL
withTag: proptag
inFolder: folder
withFID: fid];
}
return rc;
return rc;
}
- (int) getFolderTableChildproperty: (void **) data
@@ -184,28 +194,29 @@ static Class SOGoUserFolderK;
inFolder: (SOGoFolder *) folder
withFID: (uint64_t) fid
{
uint32_t *longValue;
int rc;
uint32_t *longValue;
int rc;
rc = MAPI_E_SUCCESS;
switch (proptag) {
case PR_CONTENT_UNREAD:
longValue = talloc_zero(memCtx, uint32_t);
*longValue = 0;
*data = longValue;
break;
case PR_CONTAINER_CLASS_UNICODE:
*data = talloc_strdup(memCtx, "IPF.Note");
break;
default:
rc = [super getFolderTableChildproperty: data
atURL: childURL
withTag: proptag
inFolder: folder
withFID: fid];
}
return rc;
rc = MAPI_E_SUCCESS;
switch (proptag)
{
case PR_CONTENT_UNREAD:
longValue = talloc_zero(memCtx, uint32_t);
*longValue = 0;
*data = longValue;
break;
case PR_CONTAINER_CLASS_UNICODE:
*data = talloc_strdup(memCtx, "IPF.Note");
break;
default:
rc = [super getFolderTableChildproperty: data
atURL: childURL
withTag: proptag
inFolder: folder
withFID: fid];
}
return rc;
}
@end