mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-26 05:45:24 +00:00
merge of 'c0509d9d92c69255be6d27969b4f578739e78c7f'
and 'df9680caaa44b795268f4691b92890bc37f8ee3f' Monotone-Parent: c0509d9d92c69255be6d27969b4f578739e78c7f Monotone-Parent: df9680caaa44b795268f4691b92890bc37f8ee3f Monotone-Revision: 7624d5a942129f2c8c6c2c4fd80d29b937bf470d Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-07-11T21:41:17 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -14,6 +14,15 @@
|
||||
occurrences of a floating all-day event, we must also ajdust the
|
||||
exception dates to the user's timezone.
|
||||
|
||||
2011-07-11 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* OpenChange/*: made backend ops consistent with the talloc API,
|
||||
where resources are allocated in a tree of "talloc contexts".
|
||||
|
||||
* OpenChange/NSObject+MAPIStore.m (-tallocWrapper:): new method
|
||||
enabling the wrapping of obj-c objects into talloc structures, in
|
||||
order to ease memory management.
|
||||
|
||||
2011-07-08 Francis Lachapelle <flachapelle@inverse.ca>
|
||||
|
||||
* UI/MailerUI/UIxMailListActions.m (-getUIDsAndHeadersInFolder)
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
- (void) setAID: (uint32_t) newAID;
|
||||
- (uint32_t) AID;
|
||||
|
||||
- (int) openEmbeddedMessage: (void **) message
|
||||
- (int) openEmbeddedMessage: (MAPIStoreAttachmentMessage **) message
|
||||
withMID: (uint64_t *) mid
|
||||
withMAPIStoreMsg: (struct mapistore_message *) mapistoreMsg
|
||||
andFlags: (enum OpenEmbeddedMessage_OpenModeFlags) flags;
|
||||
|
||||
@@ -67,6 +67,7 @@
|
||||
|
||||
- (int) getProperty: (void **) data
|
||||
withTag: (enum MAPITAGS) propTag
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
int rc;
|
||||
|
||||
@@ -90,7 +91,7 @@
|
||||
return rc;
|
||||
}
|
||||
|
||||
- (int) openEmbeddedMessage: (void **) message
|
||||
- (int) openEmbeddedMessage: (MAPIStoreAttachmentMessage **) message
|
||||
withMID: (uint64_t *) mid
|
||||
withMAPIStoreMsg: (struct mapistore_message *) mapistoreMsg
|
||||
andFlags: (enum OpenEmbeddedMessage_OpenModeFlags) flags
|
||||
@@ -113,7 +114,6 @@
|
||||
withID: *mid];
|
||||
}
|
||||
*message = attMessage;
|
||||
[attMessage retain];
|
||||
|
||||
return (attMessage ? MAPISTORE_SUCCESS : MAPISTORE_ERROR);
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
|
||||
- (int) getProperty: (void **) data
|
||||
withTag: (enum MAPITAGS) propTag
|
||||
inMemCtx: (TALLOC_CTX *) localMemCtx
|
||||
{
|
||||
int rc;
|
||||
|
||||
@@ -43,13 +44,13 @@
|
||||
switch (propTag)
|
||||
{
|
||||
case PR_ATTACHMENT_HIDDEN:
|
||||
*data = MAPIBoolValue (memCtx, YES);
|
||||
*data = MAPIBoolValue (localMemCtx, YES);
|
||||
break;
|
||||
case PR_ATTACHMENT_FLAGS:
|
||||
*data = MAPILongValue (memCtx, 0x00000002); /* afException */
|
||||
*data = MAPILongValue (localMemCtx, 0x00000002); /* afException */
|
||||
break;
|
||||
case PR_ATTACH_METHOD:
|
||||
*data = MAPILongValue (memCtx, 0x00000005); /* afEmbeddedMessage */
|
||||
*data = MAPILongValue (localMemCtx, 0x00000005); /* afEmbeddedMessage */
|
||||
break;
|
||||
|
||||
// case PidTagExceptionStartTime:
|
||||
@@ -57,7 +58,7 @@
|
||||
// case PidTagExceptionReplaceTime:
|
||||
|
||||
default:
|
||||
rc = [super getProperty: data withTag: propTag];
|
||||
rc = [super getProperty: data withTag: propTag inMemCtx: localMemCtx];
|
||||
}
|
||||
|
||||
return rc;
|
||||
|
||||
@@ -115,11 +115,10 @@ static NSTimeZone *utcTZ;
|
||||
[calendar removeChildren: otherEvents];
|
||||
[otherEvents release];
|
||||
|
||||
blob = [mapiRecurrenceData asBinaryInMemCtx: memCtx];
|
||||
pattern = get_AppointmentRecurrencePattern (memCtx, blob);
|
||||
blob = [mapiRecurrenceData asBinaryInMemCtx: NULL];
|
||||
pattern = get_AppointmentRecurrencePattern (blob, blob);
|
||||
[calendar setupRecurrenceWithMasterEntity: event
|
||||
fromRecurrencePattern: &pattern->RecurrencePattern];
|
||||
talloc_free (pattern);
|
||||
talloc_free (blob);
|
||||
}
|
||||
|
||||
@@ -146,7 +145,8 @@ _fillAppointmentRecurrencePattern (struct AppointmentRecurrencePattern *arp,
|
||||
arp->ReservedBlock2Size = 0; */
|
||||
}
|
||||
|
||||
- (struct SBinary_short *) _computeAppointmentRecur
|
||||
- (struct SBinary_short *) _computeAppointmentRecurInMemCtx: (TALLOC_CTX *) memCtx
|
||||
|
||||
{
|
||||
struct AppointmentRecurrencePattern *arp;
|
||||
struct Binary_r *bin;
|
||||
@@ -188,6 +188,7 @@ _fillAppointmentRecurrencePattern (struct AppointmentRecurrencePattern *arp,
|
||||
|
||||
/* getters */
|
||||
- (int) getPrIconIndex: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
uint32_t longValue;
|
||||
iCalEvent *event;
|
||||
@@ -212,6 +213,7 @@ _fillAppointmentRecurrencePattern (struct AppointmentRecurrencePattern *arp,
|
||||
}
|
||||
|
||||
- (int) getPrMessageClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = talloc_strdup(memCtx, "IPM.Appointment");
|
||||
|
||||
@@ -219,6 +221,7 @@ _fillAppointmentRecurrencePattern (struct AppointmentRecurrencePattern *arp,
|
||||
}
|
||||
|
||||
- (int) getPrStartDate: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSCalendarDate *dateValue;
|
||||
iCalEvent *event;
|
||||
@@ -236,16 +239,19 @@ _fillAppointmentRecurrencePattern (struct AppointmentRecurrencePattern *arp,
|
||||
}
|
||||
|
||||
- (int) getPidLidAppointmentStartWhole: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPrStartDate: data];
|
||||
return [self getPrStartDate: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidCommonStart: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPrStartDate: data];
|
||||
return [self getPrStartDate: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrEndDate: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSCalendarDate *dateValue;
|
||||
iCalEvent *event;
|
||||
@@ -268,16 +274,19 @@ _fillAppointmentRecurrencePattern (struct AppointmentRecurrencePattern *arp,
|
||||
}
|
||||
|
||||
- (int) getPidLidAppointmentEndWhole: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPrEndDate: data];
|
||||
return [self getPrEndDate: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidCommonEnd: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPrEndDate: data];
|
||||
return [self getPrEndDate: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidAppointmentDuration: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSTimeInterval timeValue;
|
||||
iCalEvent *event;
|
||||
@@ -291,6 +300,7 @@ _fillAppointmentRecurrencePattern (struct AppointmentRecurrencePattern *arp,
|
||||
}
|
||||
|
||||
- (int) getPidLidAppointmentSubType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
iCalEvent *event;
|
||||
|
||||
@@ -301,6 +311,7 @@ _fillAppointmentRecurrencePattern (struct AppointmentRecurrencePattern *arp,
|
||||
}
|
||||
|
||||
- (int) getPidLidBusyStatus: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, 0x02);
|
||||
|
||||
@@ -308,6 +319,7 @@ _fillAppointmentRecurrencePattern (struct AppointmentRecurrencePattern *arp,
|
||||
}
|
||||
|
||||
- (int) getPrSubject: (void **) data // SUMMARY
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
iCalEvent *event;
|
||||
|
||||
@@ -318,6 +330,7 @@ _fillAppointmentRecurrencePattern (struct AppointmentRecurrencePattern *arp,
|
||||
}
|
||||
|
||||
- (int) getPidLidLocation: (void **) data // LOCATION
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
iCalEvent *event;
|
||||
|
||||
@@ -328,17 +341,20 @@ _fillAppointmentRecurrencePattern (struct AppointmentRecurrencePattern *arp,
|
||||
}
|
||||
|
||||
- (int) getPidLidPrivate: (void **) data // private (bool), should depend on CLASS and permissions
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getNo: data];
|
||||
return [self getNo: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrSensitivity: (void **) data // not implemented, depends on CLASS
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
// normal = 0, personal?? = 1, private = 2, confidential = 3
|
||||
return [self getLongZero: data];
|
||||
return [self getLongZero: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrImportance: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
uint32_t v;
|
||||
iCalEvent *event;
|
||||
@@ -357,6 +373,7 @@ _fillAppointmentRecurrencePattern (struct AppointmentRecurrencePattern *arp,
|
||||
}
|
||||
|
||||
- (int) getPidLidIsRecurring: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
iCalEvent *event;
|
||||
|
||||
@@ -367,6 +384,7 @@ _fillAppointmentRecurrencePattern (struct AppointmentRecurrencePattern *arp,
|
||||
}
|
||||
|
||||
- (int) getPidLidRecurring: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
iCalEvent *event;
|
||||
|
||||
@@ -377,6 +395,7 @@ _fillAppointmentRecurrencePattern (struct AppointmentRecurrencePattern *arp,
|
||||
}
|
||||
|
||||
- (int) getPidLidAppointmentRecur: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
int rc = MAPISTORE_SUCCESS;
|
||||
iCalEvent *event;
|
||||
@@ -384,7 +403,7 @@ _fillAppointmentRecurrencePattern (struct AppointmentRecurrencePattern *arp,
|
||||
event = [sogoObject component: NO secure: NO];
|
||||
|
||||
if ([event isRecurrent])
|
||||
*data = [self _computeAppointmentRecur];
|
||||
*data = [self _computeAppointmentRecurInMemCtx: memCtx];
|
||||
else
|
||||
rc = MAPISTORE_ERR_NOT_FOUND;
|
||||
|
||||
@@ -392,6 +411,7 @@ _fillAppointmentRecurrencePattern (struct AppointmentRecurrencePattern *arp,
|
||||
}
|
||||
|
||||
- (void) openMessage: (struct mapistore_message *) msg
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *text;
|
||||
NSArray *attendees;
|
||||
@@ -400,7 +420,7 @@ _fillAppointmentRecurrencePattern (struct AppointmentRecurrencePattern *arp,
|
||||
int count, max;
|
||||
iCalEvent *event;
|
||||
|
||||
[super openMessage: msg];
|
||||
[super openMessage: msg inMemCtx: memCtx];
|
||||
|
||||
event = [sogoObject component: NO secure: NO];
|
||||
attendees = [event attendees];
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
@implementation MAPIStoreContactsMessage
|
||||
|
||||
- (int) getPrIconIndex: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
/* see http://msdn.microsoft.com/en-us/library/cc815472.aspx */
|
||||
*data = MAPILongValue (memCtx, 0x00000200);
|
||||
@@ -57,6 +58,7 @@
|
||||
}
|
||||
|
||||
- (int) getPrMessageClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = talloc_strdup (memCtx, "IPM.Contact");
|
||||
|
||||
@@ -64,6 +66,7 @@
|
||||
}
|
||||
|
||||
- (int) getPrOabName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = talloc_strdup (memCtx, "PR_OAB_NAME_UNICODE");
|
||||
|
||||
@@ -71,6 +74,7 @@
|
||||
}
|
||||
|
||||
- (int) getPrOabLangid: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
/* see http://msdn.microsoft.com/en-us/goglobal/bb895996.asxp */
|
||||
/* English US */
|
||||
@@ -80,6 +84,7 @@
|
||||
}
|
||||
|
||||
- (int) getPrTitle: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *stringValue;
|
||||
|
||||
@@ -90,6 +95,7 @@
|
||||
}
|
||||
|
||||
- (int) getPrCompanyName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSArray *values;
|
||||
NSString *stringValue;
|
||||
@@ -108,6 +114,7 @@
|
||||
}
|
||||
|
||||
- (int) getPrDepartmentName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSArray *values;
|
||||
NSString *stringValue;
|
||||
@@ -126,6 +133,7 @@
|
||||
}
|
||||
|
||||
- (int) getPrSendInternetEncoding: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, 0x00065001);
|
||||
|
||||
@@ -133,16 +141,19 @@
|
||||
}
|
||||
|
||||
- (int) getPrSubject: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPrDisplayName: data];
|
||||
return [self getPrDisplayName: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidFileUnder: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPrDisplayName: data];
|
||||
return [self getPrDisplayName: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidFileUnderId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, 0xffffffff);
|
||||
|
||||
@@ -150,6 +161,7 @@
|
||||
}
|
||||
|
||||
- (int) getPidLidEmail1DisplayName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NGVCard *vCard;
|
||||
NSString *fn, *email;
|
||||
@@ -164,11 +176,13 @@
|
||||
}
|
||||
|
||||
- (int) getPidLidEmail1OriginalDisplayName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPidLidEmail1DisplayName: data];
|
||||
return [self getPidLidEmail1DisplayName: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidEmail1EmailAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *stringValue;
|
||||
|
||||
@@ -179,11 +193,13 @@
|
||||
}
|
||||
|
||||
- (int) getPrAccount: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPidLidEmail1EmailAddress: data];
|
||||
return [self getPidLidEmail1EmailAddress: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrContactEmailAddresses: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *stringValue;
|
||||
|
||||
@@ -197,6 +213,7 @@
|
||||
}
|
||||
|
||||
- (int) getPrEmsAbTargetAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *stringValue;
|
||||
|
||||
@@ -208,6 +225,7 @@
|
||||
}
|
||||
|
||||
- (int) getPrSearchKey: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *stringValue;
|
||||
|
||||
@@ -219,11 +237,13 @@
|
||||
}
|
||||
|
||||
- (int) getPrMailPermission: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getYes: data];
|
||||
return [self getYes: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidEmail2EmailAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSMutableArray *emails;
|
||||
NSString *email, *stringValue;
|
||||
@@ -257,11 +277,13 @@
|
||||
}
|
||||
|
||||
- (int) getPidLidEmail2OriginalDisplayName: (void **) data // Other email
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPidLidEmail2EmailAddress: data];
|
||||
return [self getPidLidEmail2EmailAddress: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrBody: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *stringValue;
|
||||
|
||||
@@ -276,6 +298,7 @@
|
||||
excluding: (NSString *) aTypeToExclude
|
||||
atPos: (NSUInteger) pos
|
||||
inData: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSArray *elements;
|
||||
CardElement *ce;
|
||||
@@ -307,57 +330,67 @@
|
||||
}
|
||||
|
||||
- (int) getPrOfficeTelephoneNumber: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"tel" ofType: @"work" excluding: @"fax"
|
||||
atPos: 0 inData: data];
|
||||
atPos: 0 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrHomeTelephoneNumber: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"tel" ofType: @"home" excluding: @"fax"
|
||||
atPos: 0 inData: data];
|
||||
atPos: 0 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrMobileTelephoneNumber: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"tel" ofType: @"cell" excluding: nil
|
||||
atPos: 0 inData: data];
|
||||
atPos: 0 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrPrimaryTelephoneNumber: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"tel" ofType: @"pref" excluding: nil
|
||||
atPos: 0 inData: data];
|
||||
atPos: 0 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrBusinessHomePage: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"url" ofType: @"work" excluding: nil
|
||||
atPos: 0 inData: data];
|
||||
atPos: 0 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrPersonalHomePage: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"url" ofType: @"home" excluding: nil
|
||||
atPos: 0 inData: data];
|
||||
atPos: 0 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidEmail1AddressType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getSMTPAddrType: data];
|
||||
return [self getSMTPAddrType: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidEmail2AddressType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getSMTPAddrType: data];
|
||||
return [self getSMTPAddrType: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidEmail3AddressType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getSMTPAddrType: data];
|
||||
return [self getSMTPAddrType: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidInstantMessagingAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *stringValue;
|
||||
|
||||
@@ -371,6 +404,7 @@
|
||||
}
|
||||
|
||||
- (int) getPidLidPostalAddressId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSArray *elements;
|
||||
CardElement *element;
|
||||
@@ -397,90 +431,105 @@
|
||||
}
|
||||
|
||||
- (int) getPrPostalAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"label" ofType: @"pref" excluding: nil
|
||||
atPos: 0 inData: data];
|
||||
atPos: 0 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrPostOfficeBox: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"adr" ofType: @"pref" excluding: nil
|
||||
atPos: 0 inData: data];
|
||||
atPos: 0 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrStreetAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"adr" ofType: @"pref" excluding: nil
|
||||
atPos: 2 inData: data];
|
||||
atPos: 2 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrLocality: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"adr" ofType: @"pref" excluding: nil
|
||||
atPos: 3 inData: data];
|
||||
atPos: 3 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrStateOrProvince: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"adr" ofType: @"pref" excluding: nil
|
||||
atPos: 4 inData: data];
|
||||
atPos: 4 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrPostalCode: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"adr" ofType: @"pref" excluding: nil
|
||||
atPos: 5 inData: data];
|
||||
atPos: 5 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrCountry: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"adr" ofType: @"pref" excluding: nil
|
||||
atPos: 6 inData: data];
|
||||
atPos: 6 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidWorkAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"label" ofType: @"work" excluding: nil
|
||||
atPos: 0 inData: data];
|
||||
atPos: 0 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidWorkAddressPostOfficeBox: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"adr" ofType: @"work" excluding: nil
|
||||
atPos: 0 inData: data];
|
||||
atPos: 0 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidWorkAddressStreet: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"adr" ofType: @"work" excluding: nil
|
||||
atPos: 2 inData: data];
|
||||
atPos: 2 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidWorkAddressCity: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"adr" ofType: @"work" excluding: nil
|
||||
atPos: 3 inData: data];
|
||||
atPos: 3 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidWorkAddressState: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"adr" ofType: @"work" excluding: nil
|
||||
atPos: 4 inData: data];
|
||||
atPos: 4 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidWorkAddressPostalCode: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"adr" ofType: @"work" excluding: nil
|
||||
atPos: 5 inData: data];
|
||||
atPos: 5 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidWorkAddressCountry: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"adr" ofType: @"work" excluding: nil
|
||||
atPos: 6 inData: data];
|
||||
atPos: 6 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrNickname: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *stringValue;
|
||||
|
||||
@@ -491,6 +540,7 @@
|
||||
}
|
||||
|
||||
- (int) getPrBirthday: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSCalendarDate *dateValue;
|
||||
NSString *stringValue;
|
||||
@@ -599,8 +649,7 @@
|
||||
[newCard addChild: element];
|
||||
}
|
||||
if (postalAddressId == 2)
|
||||
[element addAttribute: @"type"
|
||||
value: @"pref"];
|
||||
[element addAttribute: @"type" value: @"pref"];
|
||||
value = [newProperties objectForKey: MAPIPropertyKey (PidLidWorkAddressPostOfficeBox)];
|
||||
if (value)
|
||||
[element setValue: 0 to: value];
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
#ifndef MAPISTORECONTEXT_H
|
||||
#define MAPISTORECONTEXT_H
|
||||
|
||||
#include <talloc.h>
|
||||
|
||||
#import <Foundation/NSObject.h>
|
||||
|
||||
@class NSArray;
|
||||
@@ -41,13 +43,15 @@
|
||||
@class SOGoObject;
|
||||
|
||||
@class MAPIStoreAuthenticator;
|
||||
@class MAPIStoreAttachment;
|
||||
@class MAPIStoreAttachmentTable;
|
||||
@class MAPIStoreFolder;
|
||||
@class MAPIStoreMapping;
|
||||
@class MAPIStoreTable;
|
||||
|
||||
@interface MAPIStoreContext : NSObject
|
||||
{
|
||||
struct mapistore_context *memCtx;
|
||||
struct mapistore_context *mstoreCtx;
|
||||
struct mapistore_connection_info *connInfo;
|
||||
|
||||
NSURL *contextUrl;
|
||||
@@ -100,7 +104,8 @@
|
||||
/* backend methods */
|
||||
- (int) getPath: (char **) path
|
||||
ofFMID: (uint64_t) fmid
|
||||
withTableType: (uint8_t) tableType;
|
||||
withTableType: (uint8_t) tableType
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
|
||||
- (int) getFID: (uint64_t *) fid
|
||||
byName: (const char *) foldername
|
||||
@@ -119,7 +124,8 @@
|
||||
atPosition: (uint32_t) pos
|
||||
withTableType: (uint8_t) tableType
|
||||
andQueryType: (enum table_query_type) queryType
|
||||
inFID: (uint64_t) fid;
|
||||
inFID: (uint64_t) fid
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
|
||||
- (int) mkDir: (struct SRow *) aRow
|
||||
withFID: (uint64_t) fid
|
||||
@@ -133,7 +139,8 @@
|
||||
inFID: (uint64_t) fid;
|
||||
- (int) openMessage: (struct mapistore_message *) msg
|
||||
withMID: (uint64_t) mid
|
||||
inFID: (uint64_t) fid;
|
||||
inFID: (uint64_t) fid
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) createMessageWithMID: (uint64_t) mid
|
||||
inFID: (uint64_t) fid
|
||||
isAssociated: (BOOL) isAssociated;
|
||||
@@ -144,9 +151,11 @@
|
||||
- (int) getProperties: (struct SPropTagArray *) SPropTagArray
|
||||
ofTableType: (uint8_t) tableType
|
||||
inRow: (struct SRow *) aRow
|
||||
withMID: (uint64_t) fmid;
|
||||
withMID: (uint64_t) fmid
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getAvailableProperties: (struct SPropTagArray **) propertiesP
|
||||
ofTableType: (uint8_t) type;
|
||||
ofTableType: (uint8_t) type
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) setPropertiesWithFMID: (uint64_t) fmid
|
||||
ofTableType: (uint8_t) tableType
|
||||
inRow: (struct SRow *) aRow;
|
||||
@@ -171,21 +180,21 @@
|
||||
- (void) setupBaseFolder: (NSURL *) newURL;
|
||||
|
||||
/* proof of concept */
|
||||
- (int) getTable: (void **) table
|
||||
- (int) getTable: (MAPIStoreTable **) tablePtr
|
||||
andRowCount: (uint32_t *) count
|
||||
withFID: (uint64_t) fid
|
||||
tableType: (uint8_t) tableType
|
||||
andHandleId: (uint32_t) handleId;
|
||||
|
||||
- (int) getAttachmentTable: (void **) table
|
||||
- (int) getAttachmentTable: (MAPIStoreAttachmentTable **) tablePtr
|
||||
andRowCount: (uint32_t *) count
|
||||
withMID: (uint64_t) mid;
|
||||
- (int) getAttachment: (void **) attachment
|
||||
- (int) getAttachment: (MAPIStoreAttachment **) attachmentPr
|
||||
withAID: (uint32_t) aid
|
||||
inMID: (uint64_t) mid;
|
||||
|
||||
|
||||
- (int) createAttachment: (void **) attachmentPtr
|
||||
- (int) createAttachment: (MAPIStoreAttachment **) attachmentPtr
|
||||
inAID: (uint32_t *) aid
|
||||
withMessage: (uint64_t) mid;
|
||||
|
||||
|
||||
@@ -229,7 +229,7 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
|
||||
withID: newFid];
|
||||
contextFid = newFid;
|
||||
|
||||
memCtx = newConnInfo->mstore_ctx;
|
||||
mstoreCtx = newConnInfo->mstore_ctx;
|
||||
connInfo = newConnInfo;
|
||||
}
|
||||
|
||||
@@ -682,6 +682,7 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
|
||||
withTableType: (uint8_t) tableType
|
||||
andQueryType: (enum table_query_type) queryType
|
||||
inFID: (uint64_t) fid
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *folderURL;
|
||||
MAPIStoreTable *table;
|
||||
@@ -699,7 +700,7 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
|
||||
object = [table childAtRowID: pos forQueryType: queryType];
|
||||
if (object)
|
||||
{
|
||||
rc = [object getProperty: data withTag: propTag];
|
||||
rc = [object getProperty: data withTag: propTag inMemCtx: memCtx];
|
||||
if (rc == MAPISTORE_ERR_NOT_FOUND)
|
||||
rc = MAPI_E_NOT_FOUND;
|
||||
else if (rc == MAPISTORE_ERR_NO_MEMORY)
|
||||
@@ -730,19 +731,20 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
|
||||
|
||||
- (int) getAvailableProperties: (struct SPropTagArray **) propertiesP
|
||||
ofTableType: (uint8_t) type
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
int rc = MAPISTORE_SUCCESS;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case MAPISTORE_FOLDER_TABLE:
|
||||
[[baseFolder class] getAvailableProperties: propertiesP];
|
||||
[[baseFolder class] getAvailableProperties: propertiesP inMemCtx: memCtx];
|
||||
break;
|
||||
case MAPISTORE_MESSAGE_TABLE:
|
||||
[[baseFolder messageClass] getAvailableProperties: propertiesP];
|
||||
[[baseFolder messageClass] getAvailableProperties: propertiesP inMemCtx: memCtx];
|
||||
break;
|
||||
case MAPISTORE_FAI_TABLE:
|
||||
[MAPIStoreFAIMessage getAvailableProperties: propertiesP];
|
||||
[MAPIStoreFAIMessage getAvailableProperties: propertiesP inMemCtx: memCtx];
|
||||
break;
|
||||
case MAPISTORE_RULE_TABLE:
|
||||
[self errorWithFormat: @"%s: rules not handled yet",
|
||||
@@ -762,6 +764,7 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
|
||||
- (int) openMessage: (struct mapistore_message *) msg
|
||||
withMID: (uint64_t) mid
|
||||
inFID: (uint64_t) fid
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *messageKey, *messageURL;
|
||||
MAPIStoreMessage *message;
|
||||
@@ -787,7 +790,7 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
|
||||
message = [folder lookupChild: messageKey];
|
||||
if (message)
|
||||
{
|
||||
[message openMessage: msg];
|
||||
[message openMessage: msg inMemCtx: memCtx];
|
||||
[messages setObject: message forKey: midKey];
|
||||
rc = MAPISTORE_SUCCESS;
|
||||
}
|
||||
@@ -879,7 +882,7 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
|
||||
|
||||
/* folder modified */
|
||||
notif_parameters
|
||||
= talloc_zero(memCtx,
|
||||
= talloc_zero(NULL,
|
||||
struct mapistore_object_notification_parameters);
|
||||
notif_parameters->object_id = folderId;
|
||||
if ([message isNew])
|
||||
@@ -897,12 +900,13 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
|
||||
MAPISTORE_FOLDER,
|
||||
MAPISTORE_OBJECT_MODIFIED,
|
||||
notif_parameters);
|
||||
talloc_free (notif_parameters);
|
||||
|
||||
/* message created */
|
||||
if ([message isNew])
|
||||
{
|
||||
notif_parameters
|
||||
= talloc_zero(memCtx,
|
||||
= talloc_zero(NULL,
|
||||
struct mapistore_object_notification_parameters);
|
||||
notif_parameters->object_id = [message objectId];
|
||||
notif_parameters->folder_id = folderId;
|
||||
@@ -969,6 +973,7 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
|
||||
ofTableType: (uint8_t) tableType
|
||||
inRow: (struct SRow *) aRow
|
||||
withMID: (uint64_t) fmid
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSNumber *midKey;
|
||||
MAPIStoreObject *child;
|
||||
@@ -995,7 +1000,8 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
|
||||
sizeof (struct mapistore_property_data) * sPropTagArray->cValues);
|
||||
rc = [child getProperties: data
|
||||
withTags: sPropTagArray->aulPropTag
|
||||
andCount: sPropTagArray->cValues];
|
||||
andCount: sPropTagArray->cValues
|
||||
inMemCtx: memCtx];
|
||||
if (rc == MAPISTORE_SUCCESS)
|
||||
{
|
||||
aRow->lpProps = talloc_array (aRow, struct SPropValue,
|
||||
@@ -1051,6 +1057,7 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
|
||||
- (int) getPath: (char **) path
|
||||
ofFMID: (uint64_t) fmid
|
||||
withTableType: (uint8_t) tableType
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
int rc;
|
||||
NSString *objectURL, *url;
|
||||
@@ -1327,7 +1334,7 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
|
||||
{
|
||||
/* folder notification */
|
||||
notif_parameters
|
||||
= talloc_zero(memCtx,
|
||||
= talloc_zero(NULL,
|
||||
struct mapistore_object_notification_parameters);
|
||||
notif_parameters->object_id = fid;
|
||||
notif_parameters->tag_count = 5;
|
||||
@@ -1349,7 +1356,7 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
|
||||
|
||||
/* message notification */
|
||||
notif_parameters
|
||||
= talloc_zero(memCtx,
|
||||
= talloc_zero(NULL,
|
||||
struct mapistore_object_notification_parameters);
|
||||
notif_parameters->object_id = mid;
|
||||
notif_parameters->folder_id = fid;
|
||||
@@ -1479,16 +1486,16 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
|
||||
openchangedb_get_new_folderID (connInfo->oc_ctx, &mappingId);
|
||||
[mapping registerURL: childURL withID: mappingId];
|
||||
contextId = 0;
|
||||
mapistore_search_context_by_uri (memCtx, [folderURL UTF8String] + 7,
|
||||
mapistore_search_context_by_uri (mstoreCtx, [folderURL UTF8String] + 7,
|
||||
&contextId);
|
||||
mapistore_indexing_record_add_mid (memCtx, contextId, mappingId);
|
||||
mapistore_indexing_record_add_mid (mstoreCtx, contextId, mappingId);
|
||||
}
|
||||
|
||||
return mappingId;
|
||||
}
|
||||
|
||||
/* proof of concept */
|
||||
- (int) getTable: (void **) tablePtr
|
||||
- (int) getTable: (MAPIStoreTable **) tablePtr
|
||||
andRowCount: (uint32_t *) countPtr
|
||||
withFID: (uint64_t) fid
|
||||
tableType: (uint8_t) tableType
|
||||
@@ -1497,7 +1504,6 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
|
||||
MAPIStoreTable *table;
|
||||
|
||||
table = [self _tableForFID: fid andTableType: tableType];
|
||||
[table retain];
|
||||
[table setHandleId: handleId];
|
||||
*countPtr = [[table childKeys] count];
|
||||
*tablePtr = table;
|
||||
@@ -1505,7 +1511,7 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getAttachmentTable: (void **) tablePtr
|
||||
- (int) getAttachmentTable: (MAPIStoreAttachmentTable **) tablePtr
|
||||
andRowCount: (uint32_t *) count
|
||||
withMID: (uint64_t) mid
|
||||
{
|
||||
@@ -1525,7 +1531,6 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
|
||||
attTable = [message attachmentTable];
|
||||
if (attTable)
|
||||
{
|
||||
[attTable retain];
|
||||
*tablePtr = attTable;
|
||||
rc = MAPISTORE_SUCCESS;
|
||||
}
|
||||
@@ -1534,7 +1539,7 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
|
||||
return rc;
|
||||
}
|
||||
|
||||
- (int) getAttachment: (void **) attachmentPtr
|
||||
- (int) getAttachment: (MAPIStoreAttachment **) attachmentPtr
|
||||
withAID: (uint32_t) aid
|
||||
inMID: (uint64_t) mid
|
||||
{
|
||||
@@ -1557,7 +1562,6 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
|
||||
attachment = [message lookupChild: [keys objectAtIndex: aid]];
|
||||
if (attachment)
|
||||
{
|
||||
[attachment retain];
|
||||
*attachmentPtr = attachment;
|
||||
rc = MAPISTORE_SUCCESS;
|
||||
}
|
||||
@@ -1567,7 +1571,7 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
|
||||
return rc;
|
||||
}
|
||||
|
||||
- (int) createAttachment: (void **) attachmentPtr
|
||||
- (int) createAttachment: (MAPIStoreAttachment **) attachmentPtr
|
||||
inAID: (uint32_t *) aid
|
||||
withMessage: (uint64_t) mid
|
||||
{
|
||||
@@ -1585,7 +1589,6 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
|
||||
attachment = [message createAttachment];
|
||||
if (attachment)
|
||||
{
|
||||
[attachment retain];
|
||||
*attachmentPtr = attachment;
|
||||
*aid = [attachment AID];
|
||||
rc = MAPISTORE_SUCCESS;
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
}
|
||||
|
||||
- (int) getPrMessageFlags: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
unsigned int v = MSGFLAG_FROMME;
|
||||
|
||||
|
||||
@@ -25,8 +25,9 @@
|
||||
@implementation MAPIStoreFAIMessage
|
||||
|
||||
- (int) getPrAssociated: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getYes: data];
|
||||
return [self getYes: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
|
||||
- (enum MAPISTATUS) getProperty: (void **) data
|
||||
withTag: (enum MAPITAGS) propTag
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
id value;
|
||||
enum MAPISTATUS rc;
|
||||
@@ -73,19 +74,19 @@
|
||||
if (value)
|
||||
rc = [value getMAPIValue: data forTag: propTag inMemCtx: memCtx];
|
||||
else
|
||||
rc = [super getProperty: data withTag: propTag];
|
||||
rc = [super getProperty: data withTag: propTag inMemCtx: memCtx];
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
- (int) getPrSubject: (void **) data
|
||||
- (int) getPrSubject: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
/* if we get here, it means that the properties file didn't contain a
|
||||
relevant value */
|
||||
return [self getEmptyString: data];
|
||||
return [self getEmptyString: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrMessageClass: (void **) data
|
||||
- (int) getPrMessageClass: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
/* if we get here, it means that the properties file didn't contain a
|
||||
relevant value */
|
||||
@@ -96,6 +97,7 @@
|
||||
}
|
||||
|
||||
- (int) getAvailableProperties: (struct SPropTagArray **) propertiesP
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSArray *keys;
|
||||
NSUInteger count, max;
|
||||
|
||||
@@ -304,6 +304,7 @@ Class NSExceptionK, MAPIStoreMessageTableK, MAPIStoreFAIMessageTableK, MAPIStore
|
||||
}
|
||||
|
||||
- (int) getPrParentFid: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongLongValue (memCtx, [container objectId]);
|
||||
|
||||
@@ -311,6 +312,7 @@ Class NSExceptionK, MAPIStoreMessageTableK, MAPIStoreFAIMessageTableK, MAPIStore
|
||||
}
|
||||
|
||||
- (int) getPrFid: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongLongValue (memCtx, [self objectId]);
|
||||
|
||||
@@ -318,6 +320,7 @@ Class NSExceptionK, MAPIStoreMessageTableK, MAPIStoreFAIMessageTableK, MAPIStore
|
||||
}
|
||||
|
||||
- (int) getPrAccess: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, 0x63);
|
||||
|
||||
@@ -325,6 +328,7 @@ Class NSExceptionK, MAPIStoreMessageTableK, MAPIStoreFAIMessageTableK, MAPIStore
|
||||
}
|
||||
|
||||
- (int) getPrAccessLevel: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, 0x01);
|
||||
|
||||
@@ -332,28 +336,33 @@ Class NSExceptionK, MAPIStoreMessageTableK, MAPIStoreFAIMessageTableK, MAPIStore
|
||||
}
|
||||
|
||||
- (int) getPrAttrHidden: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getNo: data];
|
||||
return [self getNo: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrAttrSystem: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getNo: data];
|
||||
return [self getNo: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrAttrReadOnly: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getNo: data];
|
||||
return [self getNo: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrSubfolders: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPIBoolValue (memCtx, [folderKeys count] > 0);
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPrFolderChildCount: (void **) data;
|
||||
- (int) getPrFolderChildCount: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, [[self folderKeys] count]);
|
||||
|
||||
@@ -361,6 +370,7 @@ Class NSExceptionK, MAPIStoreMessageTableK, MAPIStoreFAIMessageTableK, MAPIStore
|
||||
}
|
||||
|
||||
- (int) getPrContentCount: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, [[self messageKeys] count]);
|
||||
|
||||
@@ -368,6 +378,7 @@ Class NSExceptionK, MAPIStoreMessageTableK, MAPIStoreFAIMessageTableK, MAPIStore
|
||||
}
|
||||
|
||||
- (int) getPrContentUnread: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, 0);
|
||||
|
||||
@@ -375,6 +386,7 @@ Class NSExceptionK, MAPIStoreMessageTableK, MAPIStoreFAIMessageTableK, MAPIStore
|
||||
}
|
||||
|
||||
- (int) getPrAssocContentCount: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, [[self faiMessageKeys] count]);
|
||||
|
||||
@@ -382,6 +394,7 @@ Class NSExceptionK, MAPIStoreMessageTableK, MAPIStoreFAIMessageTableK, MAPIStore
|
||||
}
|
||||
|
||||
- (int) getPrDeletedCountTotal: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
/* TODO */
|
||||
*data = MAPILongValue (memCtx, 0);
|
||||
@@ -390,6 +403,7 @@ Class NSExceptionK, MAPIStoreMessageTableK, MAPIStoreFAIMessageTableK, MAPIStore
|
||||
}
|
||||
|
||||
- (int) getPrLocalCommitTimeMax: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [[self lastMessageModificationTime] asFileTimeInMemCtx: memCtx];
|
||||
|
||||
@@ -398,6 +412,7 @@ Class NSExceptionK, MAPIStoreMessageTableK, MAPIStoreFAIMessageTableK, MAPIStore
|
||||
|
||||
- (int) getProperty: (void **) data
|
||||
withTag: (enum MAPITAGS) propTag
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
int rc;
|
||||
id value;
|
||||
@@ -407,7 +422,7 @@ Class NSExceptionK, MAPIStoreMessageTableK, MAPIStoreFAIMessageTableK, MAPIStore
|
||||
if (value)
|
||||
rc = [value getMAPIValue: data forTag: propTag inMemCtx: memCtx];
|
||||
else
|
||||
rc = [super getProperty: data withTag: propTag];
|
||||
rc = [super getProperty: data withTag: propTag inMemCtx: memCtx];
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -69,6 +69,7 @@
|
||||
|
||||
- (int) getProperty: (void **) data
|
||||
withTag: (enum MAPITAGS) propTag
|
||||
inMemCtx: (TALLOC_CTX *) localMemCtx
|
||||
{
|
||||
static char recordBytes[] = {0xd9, 0xd8, 0x11, 0xa3, 0xe2, 0x90, 0x18, 0x41,
|
||||
0x9e, 0x04, 0x58, 0x46, 0x9d, 0x6d, 0x1b, 0x68};
|
||||
@@ -82,20 +83,20 @@
|
||||
switch (propTag)
|
||||
{
|
||||
case PR_ATTACH_METHOD:
|
||||
*data = MAPILongValue (memCtx, 0x00000001); // afByValue
|
||||
*data = MAPILongValue (localMemCtx, 0x00000001); // afByValue
|
||||
break;
|
||||
case PR_ATTACH_TAG:
|
||||
*data = [[self mimeAttachTag]
|
||||
asBinaryInMemCtx: memCtx];
|
||||
asBinaryInMemCtx: localMemCtx];
|
||||
break;
|
||||
case PR_ATTACH_SIZE:
|
||||
longValue = [[bodyInfo objectForKey: @"size"] longValue];
|
||||
*data = MAPILongValue (memCtx, longValue);
|
||||
*data = MAPILongValue (localMemCtx, longValue);
|
||||
break;
|
||||
|
||||
case PR_RECORD_KEY:
|
||||
*data = [[NSData dataWithBytes: recordBytes length: 16]
|
||||
asBinaryInMemCtx: memCtx];
|
||||
asBinaryInMemCtx: localMemCtx];
|
||||
break;
|
||||
|
||||
// PR_RECORD_KEY (0xFF90102) D9 D8 11 A3 E2 90 18 41 9E 04 58 46 9D 6D 1B 68
|
||||
@@ -125,38 +126,38 @@
|
||||
stringValue = [NSString stringWithFormat: @"%@.%@", baseName, ext];
|
||||
}
|
||||
|
||||
*data = [stringValue asUnicodeInMemCtx: memCtx];
|
||||
*data = [stringValue asUnicodeInMemCtx: localMemCtx];
|
||||
break;
|
||||
|
||||
case PR_DISPLAY_NAME_UNICODE: /* TODO: check if description ? */
|
||||
stringValue = [bodyInfo objectForKey: @"description"];
|
||||
*data = [stringValue asUnicodeInMemCtx: memCtx];
|
||||
*data = [stringValue asUnicodeInMemCtx: localMemCtx];
|
||||
break;
|
||||
|
||||
case PR_ATTACH_CONTENT_ID_UNICODE:
|
||||
stringValue = [bodyInfo objectForKey: @"bodyId"];
|
||||
*data = [stringValue asUnicodeInMemCtx: memCtx];
|
||||
*data = [stringValue asUnicodeInMemCtx: localMemCtx];
|
||||
break;
|
||||
|
||||
case PR_ATTACH_MIME_TAG_UNICODE:
|
||||
stringValue = [NSString stringWithFormat: @"%@/%@",
|
||||
[bodyInfo objectForKey: @"type"],
|
||||
[bodyInfo objectForKey: @"subtype"]];
|
||||
*data = [[stringValue lowercaseString] asUnicodeInMemCtx: memCtx];
|
||||
*data = [[stringValue lowercaseString] asUnicodeInMemCtx: localMemCtx];
|
||||
break;
|
||||
|
||||
case PR_CREATION_TIME:
|
||||
case PR_LAST_MODIFICATION_TIME:
|
||||
date = [[container sogoObject] date];
|
||||
*data = [date asFileTimeInMemCtx: memCtx];
|
||||
*data = [date asFileTimeInMemCtx: localMemCtx];
|
||||
break;
|
||||
|
||||
case PR_ATTACH_DATA_BIN:
|
||||
*data = [[sogoObject fetchBLOB] asBinaryInMemCtx: memCtx];
|
||||
*data = [[sogoObject fetchBLOB] asBinaryInMemCtx: localMemCtx];
|
||||
break;
|
||||
|
||||
default:
|
||||
rc = [super getProperty: data withTag: propTag];
|
||||
rc = [super getProperty: data withTag: propTag inMemCtx: localMemCtx];
|
||||
}
|
||||
|
||||
return rc;
|
||||
|
||||
@@ -172,6 +172,7 @@ static Class SOGoMailFolderK;
|
||||
}
|
||||
|
||||
- (int) getPrContentUnread: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
EOQualifier *searchQualifier;
|
||||
uint32_t longValue;
|
||||
@@ -187,6 +188,7 @@ static Class SOGoMailFolderK;
|
||||
}
|
||||
|
||||
- (int) getPrContainerClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [@"IPF.Note" asUnicodeInMemCtx: memCtx];
|
||||
|
||||
@@ -194,6 +196,7 @@ static Class SOGoMailFolderK;
|
||||
}
|
||||
|
||||
- (int) getPrMessageClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [@"IPM.Note" asUnicodeInMemCtx: memCtx];
|
||||
|
||||
|
||||
@@ -85,12 +85,8 @@ static Class NSExceptionK, MAPIStoreSentItemsFolderK, MAPIStoreDraftsFolderK;
|
||||
MAPIStoreDraftsFolderK = [MAPIStoreDraftsFolder class];
|
||||
}
|
||||
|
||||
+ (int) getAvailableProperties: (struct SPropTagArray **) propertiesP
|
||||
{
|
||||
return [super getAvailableProperties: propertiesP];
|
||||
}
|
||||
|
||||
- (int) getPrIconIndex: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
uint32_t longValue;
|
||||
|
||||
@@ -111,6 +107,7 @@ static Class NSExceptionK, MAPIStoreSentItemsFolderK, MAPIStoreDraftsFolderK;
|
||||
}
|
||||
|
||||
- (int) getPidLidImapDeleted: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
uint32_t longValue;
|
||||
|
||||
@@ -124,6 +121,7 @@ static Class NSExceptionK, MAPIStoreSentItemsFolderK, MAPIStoreDraftsFolderK;
|
||||
}
|
||||
|
||||
- (int) getPrSubject: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *stringValue;
|
||||
|
||||
@@ -136,6 +134,7 @@ static Class NSExceptionK, MAPIStoreSentItemsFolderK, MAPIStoreDraftsFolderK;
|
||||
}
|
||||
|
||||
- (int) getPrSubjectPrefix: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *subject;
|
||||
NSUInteger colIdx;
|
||||
@@ -154,6 +153,7 @@ static Class NSExceptionK, MAPIStoreSentItemsFolderK, MAPIStoreDraftsFolderK;
|
||||
}
|
||||
|
||||
- (int) getPrNormalizedSubject: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *subject;
|
||||
NSUInteger colIdx;
|
||||
@@ -174,6 +174,7 @@ static Class NSExceptionK, MAPIStoreSentItemsFolderK, MAPIStoreDraftsFolderK;
|
||||
}
|
||||
|
||||
- (int) getPrMessageClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = talloc_strdup (memCtx, "IPM.Note");
|
||||
|
||||
@@ -181,11 +182,13 @@ static Class NSExceptionK, MAPIStoreSentItemsFolderK, MAPIStoreDraftsFolderK;
|
||||
}
|
||||
|
||||
- (int) getPrReplyRequested: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getNo: data];
|
||||
return [self getNo: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrResponseRequested: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPIBoolValue (memCtx, NO);
|
||||
|
||||
@@ -203,26 +206,31 @@ static Class NSExceptionK, MAPIStoreSentItemsFolderK, MAPIStoreDraftsFolderK;
|
||||
}
|
||||
|
||||
- (int) getPrLatestDeliveryTime: (void **) data // DOUBT
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPrCreationTime: data];
|
||||
return [self getPrCreationTime: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrOriginalSubmitTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPrCreationTime: data];
|
||||
return [self getPrCreationTime: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrClientSubmitTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPrCreationTime: data];
|
||||
return [self getPrCreationTime: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrMessageDeliveryTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPrCreationTime: data];
|
||||
return [self getPrCreationTime: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrMessageFlags: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSDictionary *coreInfos;
|
||||
NSArray *flags;
|
||||
@@ -246,6 +254,7 @@ static Class NSExceptionK, MAPIStoreSentItemsFolderK, MAPIStoreDraftsFolderK;
|
||||
}
|
||||
|
||||
- (int) getPrFlagStatus: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSDictionary *coreInfos;
|
||||
NSArray *flags;
|
||||
@@ -265,6 +274,7 @@ static Class NSExceptionK, MAPIStoreSentItemsFolderK, MAPIStoreDraftsFolderK;
|
||||
}
|
||||
|
||||
- (int) getPrFollowupIcon: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSDictionary *coreInfos;
|
||||
NSArray *flags;
|
||||
@@ -284,36 +294,43 @@ static Class NSExceptionK, MAPIStoreSentItemsFolderK, MAPIStoreDraftsFolderK;
|
||||
}
|
||||
|
||||
- (int) getPrSensitivity: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getLongZero: data];
|
||||
return [self getLongZero: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrOriginalSensitivity: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPrSensitivity: data];
|
||||
return [self getPrSensitivity: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrSentRepresentingAddrtype: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getSMTPAddrType: data];
|
||||
return [self getSMTPAddrType: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrRcvdRepresentingAddrtype: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getSMTPAddrType: data];
|
||||
return [self getSMTPAddrType: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrReceivedByAddrtype: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getSMTPAddrType: data];
|
||||
return [self getSMTPAddrType: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrSenderAddrtype: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getSMTPAddrType: data];
|
||||
return [self getSMTPAddrType: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrSenderEmailAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *stringValue;
|
||||
|
||||
@@ -327,26 +344,31 @@ static Class NSExceptionK, MAPIStoreSentItemsFolderK, MAPIStoreDraftsFolderK;
|
||||
}
|
||||
|
||||
- (int) getPrSenderName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPrSenderEmailAddress: data];
|
||||
return [self getPrSenderEmailAddress: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrOriginalAuthorName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPrSenderEmailAddress: data];
|
||||
return [self getPrSenderEmailAddress: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrSentRepresentingEmailAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPrSenderEmailAddress: data];
|
||||
return [self getPrSenderEmailAddress: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrSentRepresentingName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPrSenderEmailAddress: data];
|
||||
return [self getPrSenderEmailAddress: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrReceivedByEmailAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *stringValue;
|
||||
|
||||
@@ -360,31 +382,37 @@ static Class NSExceptionK, MAPIStoreSentItemsFolderK, MAPIStoreDraftsFolderK;
|
||||
}
|
||||
|
||||
- (int) getPrReceivedByName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPrReceivedByEmailAddress: data];
|
||||
return [self getPrReceivedByEmailAddress: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrRcvdRepresentingName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPrReceivedByEmailAddress: data];
|
||||
return [self getPrReceivedByEmailAddress: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrRcvdRepresentingEmailAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPrReceivedByEmailAddress: data];
|
||||
return [self getPrReceivedByEmailAddress: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrDisplayTo: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPrReceivedByEmailAddress: data];
|
||||
return [self getPrReceivedByEmailAddress: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrOriginalDisplayTo: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPrDisplayTo: data];
|
||||
return [self getPrDisplayTo: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrDisplayCc: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *stringValue;
|
||||
|
||||
@@ -398,21 +426,25 @@ static Class NSExceptionK, MAPIStoreSentItemsFolderK, MAPIStoreDraftsFolderK;
|
||||
}
|
||||
|
||||
- (int) getPrOriginalDisplayCc: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPrDisplayCc: data];
|
||||
return [self getPrDisplayCc: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrDisplayBcc: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getEmptyString: data];
|
||||
return [self getEmptyString: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrOriginalDisplayBcc: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPrDisplayBcc: data];
|
||||
return [self getPrDisplayBcc: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidNameContentType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [@"message/rfc822" asUnicodeInMemCtx: memCtx];
|
||||
|
||||
@@ -420,6 +452,7 @@ static Class NSExceptionK, MAPIStoreSentItemsFolderK, MAPIStoreDraftsFolderK;
|
||||
}
|
||||
|
||||
- (int) getPrImportance: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
uint32_t v;
|
||||
NSString *s;
|
||||
@@ -438,6 +471,7 @@ static Class NSExceptionK, MAPIStoreSentItemsFolderK, MAPIStoreDraftsFolderK;
|
||||
}
|
||||
|
||||
- (int) getPrInternetCpid: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
/* ref:
|
||||
http://msdn.microsoft.com/en-us/library/dd317756%28v=vs.85%29.aspx
|
||||
@@ -453,6 +487,7 @@ static Class NSExceptionK, MAPIStoreSentItemsFolderK, MAPIStoreDraftsFolderK;
|
||||
}
|
||||
|
||||
- (int) getPrBody: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSMutableArray *keys;
|
||||
id result;
|
||||
@@ -504,6 +539,7 @@ static Class NSExceptionK, MAPIStoreSentItemsFolderK, MAPIStoreDraftsFolderK;
|
||||
}
|
||||
|
||||
- (int) getPrHtml: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
id result;
|
||||
NSData *content;
|
||||
@@ -566,6 +602,7 @@ static Class NSExceptionK, MAPIStoreSentItemsFolderK, MAPIStoreDraftsFolderK;
|
||||
}
|
||||
|
||||
- (int) getPrRtfCompressed: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = NULL;
|
||||
|
||||
@@ -573,11 +610,13 @@ static Class NSExceptionK, MAPIStoreSentItemsFolderK, MAPIStoreDraftsFolderK;
|
||||
}
|
||||
|
||||
- (int) getPrRtfInSync: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getNo: data];
|
||||
return [self getNo: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrInternetMessageId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [[sogoObject messageId] asUnicodeInMemCtx: memCtx];
|
||||
|
||||
@@ -585,21 +624,25 @@ static Class NSExceptionK, MAPIStoreSentItemsFolderK, MAPIStoreDraftsFolderK;
|
||||
}
|
||||
|
||||
- (int) getPrReadReceiptRequested: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getNo: data];
|
||||
return [self getNo: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrDeleteAfterSubmit: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getNo: data];
|
||||
return [self getNo: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidPrivate: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getNo: data];
|
||||
return [self getNo: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrMsgEditorFormat: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSMutableArray *keys;
|
||||
NSArray *acceptedTypes;
|
||||
@@ -629,26 +672,31 @@ static Class NSExceptionK, MAPIStoreSentItemsFolderK, MAPIStoreDraftsFolderK;
|
||||
}
|
||||
|
||||
- (int) getPidLidReminderSet: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getNo: data];
|
||||
return [self getNo: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidUseTnef: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getNo: data];
|
||||
return [self getNo: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidRemoteStatus: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getLongZero: data];
|
||||
return [self getLongZero: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidAgingDontAgeMe: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getYes: data];
|
||||
return [self getYes: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (void) openMessage: (struct mapistore_message *) msg
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
struct SRowSet *recipients;
|
||||
NSArray *to;
|
||||
@@ -656,7 +704,7 @@ static Class NSExceptionK, MAPIStoreSentItemsFolderK, MAPIStoreDraftsFolderK;
|
||||
NGImap4EnvelopeAddress *currentAddress;
|
||||
NSString *text;
|
||||
|
||||
[super openMessage: msg];
|
||||
[super openMessage: msg inMemCtx: memCtx];
|
||||
/* Retrieve recipients from the message */
|
||||
to = [sogoObject toEnvelopeAddresses];
|
||||
max = [to count];
|
||||
|
||||
@@ -41,10 +41,12 @@
|
||||
NSMutableArray *activeTables;
|
||||
}
|
||||
|
||||
- (void) openMessage: (struct mapistore_message *) msg;
|
||||
- (void) openMessage: (struct mapistore_message *) msg
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
|
||||
/* helper getters */
|
||||
- (int) getSMTPAddrType: (void **) data;
|
||||
- (int) getSMTPAddrType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
|
||||
/* subclasses */
|
||||
- (void) submit;
|
||||
|
||||
@@ -71,6 +71,7 @@
|
||||
}
|
||||
|
||||
- (void) openMessage: (struct mapistore_message *) msg
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
static enum MAPITAGS tags[] = { PR_SUBJECT_PREFIX_UNICODE,
|
||||
PR_NORMALIZED_SUBJECT_UNICODE };
|
||||
@@ -95,7 +96,7 @@
|
||||
properties->lpProps = talloc_array (properties, struct SPropValue, max);
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
if ([self getProperty: &propValue withTag: tags[count]]
|
||||
if ([self getProperty: &propValue withTag: tags[count] inMemCtx: memCtx]
|
||||
== MAPI_E_SUCCESS)
|
||||
{
|
||||
if (propValue == NULL)
|
||||
@@ -120,7 +121,7 @@
|
||||
}
|
||||
|
||||
/* helper getters */
|
||||
- (int) getSMTPAddrType: (void **) data
|
||||
- (int) getSMTPAddrType: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [@"SMTP" asUnicodeInMemCtx: memCtx];
|
||||
|
||||
@@ -129,6 +130,7 @@
|
||||
|
||||
/* getters */
|
||||
- (int) getPrInstId: (void **) data // TODO: DOUBT
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
/* we return a unique id based on the key */
|
||||
*data = MAPILongLongValue (memCtx, [[sogoObject nameInContainer] hash]);
|
||||
@@ -137,11 +139,13 @@
|
||||
}
|
||||
|
||||
- (int) getPrInstanceNum: (void **) data // TODO: DOUBT
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getLongZero: data];
|
||||
return [self getLongZero: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrRowType: (void **) data // TODO: DOUBT
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, TBL_LEAF_ROW);
|
||||
|
||||
@@ -149,6 +153,7 @@
|
||||
}
|
||||
|
||||
- (int) getPrDepth: (void **) data // TODO: DOUBT
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongLongValue (memCtx, 0);
|
||||
|
||||
@@ -156,6 +161,7 @@
|
||||
}
|
||||
|
||||
- (int) getPrAccess: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, 0x03);
|
||||
|
||||
@@ -163,6 +169,7 @@
|
||||
}
|
||||
|
||||
- (int) getPrAccessLevel: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, 0x01);
|
||||
|
||||
@@ -171,20 +178,22 @@
|
||||
|
||||
// - (int) getPrViewStyle: (void **) data
|
||||
// {
|
||||
// return [self getLongZero: data];
|
||||
// return [self getLongZero: data inMemCtx: memCtx];
|
||||
// }
|
||||
|
||||
// - (int) getPrViewMajorversion: (void **) data
|
||||
// {
|
||||
// return [self getLongZero: data];
|
||||
// return [self getLongZero: data inMemCtx: memCtx];
|
||||
// }
|
||||
|
||||
- (int) getPidLidSideEffects: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getLongZero: data];
|
||||
return [self getLongZero: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidCurrentVersion: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, 115608); // Outlook 11.5608
|
||||
|
||||
@@ -192,6 +201,7 @@
|
||||
}
|
||||
|
||||
- (int) getPidLidCurrentVersionName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [@"11.0" asUnicodeInMemCtx: memCtx];
|
||||
|
||||
@@ -199,6 +209,7 @@
|
||||
}
|
||||
|
||||
- (int) getPidLidAutoProcessState: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, 0x00000000);
|
||||
|
||||
@@ -206,6 +217,7 @@
|
||||
}
|
||||
|
||||
- (int) getPidNameContentClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [@"Sharing" asUnicodeInMemCtx: memCtx];
|
||||
|
||||
@@ -213,6 +225,7 @@
|
||||
}
|
||||
|
||||
- (int) getPrFid: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongLongValue (memCtx, [container objectId]);
|
||||
|
||||
@@ -220,6 +233,7 @@
|
||||
}
|
||||
|
||||
- (int) getPrMid: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongLongValue (memCtx, [self objectId]);
|
||||
|
||||
@@ -227,6 +241,7 @@
|
||||
}
|
||||
|
||||
- (int) getPrMessageLocaleId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, 0x0409);
|
||||
|
||||
@@ -234,6 +249,7 @@
|
||||
}
|
||||
|
||||
- (int) getPrMessageFlags: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, MSGFLAG_FROMME | MSGFLAG_READ | MSGFLAG_UNMODIFIED);
|
||||
|
||||
@@ -241,6 +257,7 @@
|
||||
}
|
||||
|
||||
- (int) getPrMessageSize: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
/* TODO: choose another name in SOGo for that method */
|
||||
*data = MAPILongValue (memCtx, [[sogoObject davContentLength] intValue]);
|
||||
@@ -249,11 +266,13 @@
|
||||
}
|
||||
|
||||
- (int) getPrMsgStatus: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getLongZero: data];
|
||||
return [self getLongZero: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrImportance: (void **) data // TODO -> subclass?
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, 1);
|
||||
|
||||
@@ -261,16 +280,19 @@
|
||||
}
|
||||
|
||||
- (int) getPrPriority: (void **) data // TODO -> subclass?
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getLongZero: data];
|
||||
return [self getLongZero: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrSensitivity: (void **) data // TODO -> subclass in calendar
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getLongZero: data];
|
||||
return [self getLongZero: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrSubject: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
|
||||
@@ -278,38 +300,45 @@
|
||||
}
|
||||
|
||||
- (int) getPrNormalizedSubject: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPrSubject: data];
|
||||
return [self getPrSubject: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrOriginalSubject: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPrNormalizedSubject: data];
|
||||
return [self getPrNormalizedSubject: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrConversationTopic: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPrNormalizedSubject: data];
|
||||
return [self getPrNormalizedSubject: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrSubjectPrefix: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getEmptyString: data];
|
||||
return [self getEmptyString: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrDisplayTo: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getEmptyString: data];
|
||||
return [self getEmptyString: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrDisplayCc: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getEmptyString: data];
|
||||
return [self getEmptyString: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrDisplayBcc: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getEmptyString: data];
|
||||
return [self getEmptyString: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
// - (int) getPrOriginalDisplayTo: (void **) data
|
||||
@@ -328,6 +357,7 @@
|
||||
// }
|
||||
|
||||
- (int) getPrLastModifierName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSURL *contextUrl;
|
||||
|
||||
@@ -338,6 +368,7 @@
|
||||
}
|
||||
|
||||
- (int) getPrMessageClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
|
||||
@@ -345,11 +376,13 @@
|
||||
}
|
||||
|
||||
- (int) getPrOrigMessageClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPrMessageClass: data];
|
||||
return [self getPrMessageClass: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrHasattach: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPIBoolValue (memCtx,
|
||||
[[self childKeysMatchingQualifier: nil
|
||||
@@ -359,8 +392,9 @@
|
||||
}
|
||||
|
||||
- (int) getPrAssociated: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getNo: data];
|
||||
return [self getNo: data inMemCtx: memCtx];;
|
||||
}
|
||||
|
||||
- (void) save
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
@implementation MAPIStoreNotesMessage
|
||||
|
||||
- (int) getPrIconIndex: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
/* see http://msdn.microsoft.com/en-us/library/cc815472.aspx */
|
||||
// *longValue = 0x00000300 for blue
|
||||
@@ -42,9 +43,11 @@
|
||||
}
|
||||
|
||||
- (int) getPrSubject: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getProperty: data
|
||||
withTag: PR_NORMALIZED_SUBJECT_UNICODE];
|
||||
withTag: PR_NORMALIZED_SUBJECT_UNICODE
|
||||
inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
#ifndef MAPISTOREOBJECT_H
|
||||
#define MAPISTOREOBJECT_H
|
||||
|
||||
#include <talloc.h>
|
||||
|
||||
#import <Foundation/NSObject.h>
|
||||
|
||||
@class NSCalendarDate;
|
||||
@@ -45,13 +47,13 @@
|
||||
MAPIStoreObject *container;
|
||||
id sogoObject;
|
||||
NSMutableDictionary *newProperties;
|
||||
void *memCtx;
|
||||
BOOL isNew;
|
||||
}
|
||||
|
||||
+ (id) mapiStoreObjectWithSOGoObject: (id) newSOGoObject
|
||||
inContainer: (MAPIStoreObject *) newContainer;
|
||||
+ (int) getAvailableProperties: (struct SPropTagArray **) propertiesP;
|
||||
+ (int) getAvailableProperties: (struct SPropTagArray **) propertiesP
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
|
||||
- (id) initWithSOGoObject: (id) newSOGoObject
|
||||
inContainer: (MAPIStoreObject *) newFolder;
|
||||
@@ -82,33 +84,45 @@
|
||||
- (void) resetNewProperties;
|
||||
|
||||
/* ops */
|
||||
- (int) getAvailableProperties: (struct SPropTagArray **) propertiesP;
|
||||
- (int) getAvailableProperties: (struct SPropTagArray **) propertiesP
|
||||
inMemCtx: (TALLOC_CTX *) localMemCtx;
|
||||
- (int) getProperties: (struct mapistore_property_data *) data
|
||||
withTags: (enum MAPITAGS *) tags
|
||||
andCount: (uint16_t) columnCount;
|
||||
andCount: (uint16_t) columnCount
|
||||
inMemCtx: (TALLOC_CTX *) localMemCtx;
|
||||
|
||||
- (int) setProperties: (struct SRow *) aRow;
|
||||
|
||||
- (int) getProperty: (void **) data
|
||||
withTag: (enum MAPITAGS) propTag;
|
||||
withTag: (enum MAPITAGS) propTag
|
||||
inMemCtx: (TALLOC_CTX *) localMemCtx;
|
||||
|
||||
/* helper getters */
|
||||
- (int) getEmptyString: (void **) data;
|
||||
- (int) getLongZero: (void **) data;
|
||||
- (int) getYes: (void **) data;
|
||||
- (int) getNo: (void **) data;
|
||||
- (int) getEmptyString: (void **) data inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getLongZero: (void **) data inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getYes: (void **) data inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getNo: (void **) data inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getReplicaKey: (void **) data
|
||||
fromGlobCnt: (uint64_t) objectCnt;
|
||||
fromGlobCnt: (uint64_t) objectCnt
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
|
||||
/* implemented getters */
|
||||
- (int) getPrDisplayName: (void **) data;
|
||||
- (int) getPrSearchKey: (void **) data;
|
||||
- (int) getPrGenerateExchangeViews: (void **) data;
|
||||
- (int) getPrParentSourceKey: (void **) data;
|
||||
- (int) getPrSourceKey: (void **) data;
|
||||
- (int) getPrChangeKey: (void **) data;
|
||||
- (int) getPrCreationTime: (void **) data;
|
||||
- (int) getPrLastModificationTime: (void **) data;
|
||||
- (int) getPrDisplayName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPrSearchKey: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPrGenerateExchangeViews: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPrParentSourceKey: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPrSourceKey: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPrChangeKey: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPrCreationTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPrLastModificationTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
|
||||
/* subclasses */
|
||||
- (NSDate *) creationTime;
|
||||
|
||||
@@ -64,6 +64,7 @@ static Class NSExceptionK, MAPIStoreFolderK;
|
||||
}
|
||||
|
||||
+ (int) getAvailableProperties: (struct SPropTagArray **) propertiesP
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
struct SPropTagArray *properties;
|
||||
const MAPIStorePropertyGetter *classGetters;
|
||||
@@ -71,7 +72,7 @@ static Class NSExceptionK, MAPIStoreFolderK;
|
||||
enum MAPITAGS propTag;
|
||||
uint16_t propValue;
|
||||
|
||||
properties = talloc_zero(NULL, struct SPropTagArray);
|
||||
properties = talloc_zero(memCtx, struct SPropTagArray);
|
||||
properties->aulPropTag = talloc_array (properties, enum MAPITAGS,
|
||||
MAPIStoreSupportedPropertiesCount);
|
||||
classGetters = MAPIStorePropertyGettersForClass (self);
|
||||
@@ -101,7 +102,6 @@ static Class NSExceptionK, MAPIStoreFolderK;
|
||||
container = nil;
|
||||
sogoObject = nil;
|
||||
newProperties = [NSMutableDictionary new];
|
||||
memCtx = talloc_size (NULL, 0);
|
||||
isNew = NO;
|
||||
}
|
||||
|
||||
@@ -126,7 +126,6 @@ static Class NSExceptionK, MAPIStoreFolderK;
|
||||
[newProperties release];
|
||||
[parentContainersBag release];
|
||||
[container release];
|
||||
talloc_free (memCtx);
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@@ -222,6 +221,7 @@ static Class NSExceptionK, MAPIStoreFolderK;
|
||||
|
||||
- (int) getProperty: (void **) data
|
||||
withTag: (enum MAPITAGS) propTag
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
MAPIStorePropertyGetter method = NULL;
|
||||
uint16_t propValue;
|
||||
@@ -234,7 +234,7 @@ static Class NSExceptionK, MAPIStoreFolderK;
|
||||
|
||||
method = (MAPIStorePropertyGetter) classGetters[propValue];
|
||||
if (method)
|
||||
rc = method (self, methodSel, data);
|
||||
rc = method (self, methodSel, data, memCtx);
|
||||
else
|
||||
{
|
||||
*data = NULL;
|
||||
@@ -256,28 +256,28 @@ static Class NSExceptionK, MAPIStoreFolderK;
|
||||
}
|
||||
|
||||
/* helper getters */
|
||||
- (int) getEmptyString: (void **) data
|
||||
- (int) getEmptyString: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [@"" asUnicodeInMemCtx: memCtx];
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getLongZero: (void **) data
|
||||
- (int) getLongZero: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, 0);
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getYes: (void **) data
|
||||
- (int) getYes: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPIBoolValue (memCtx, YES);
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getNo: (void **) data
|
||||
- (int) getNo: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPIBoolValue (memCtx, NO);
|
||||
|
||||
@@ -286,6 +286,7 @@ static Class NSExceptionK, MAPIStoreFolderK;
|
||||
|
||||
- (int) getReplicaKey: (void **) data
|
||||
fromGlobCnt: (uint64_t) objectCnt
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
struct mapistore_connection_info *connInfo;
|
||||
NSMutableData *replicaKey;
|
||||
@@ -312,6 +313,7 @@ static Class NSExceptionK, MAPIStoreFolderK;
|
||||
|
||||
/* getters */
|
||||
- (int) getPrDisplayName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [[sogoObject displayName] asUnicodeInMemCtx: memCtx];
|
||||
|
||||
@@ -319,6 +321,7 @@ static Class NSExceptionK, MAPIStoreFolderK;
|
||||
}
|
||||
|
||||
- (int) getPrSearchKey: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *stringValue;
|
||||
|
||||
@@ -330,18 +333,23 @@ static Class NSExceptionK, MAPIStoreFolderK;
|
||||
}
|
||||
|
||||
- (int) getPrGenerateExchangeViews: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getNo: data];
|
||||
return [self getNo: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrParentSourceKey: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getReplicaKey: data fromGlobCnt: [container objectId] >> 16];
|
||||
return [self getReplicaKey: data fromGlobCnt: [container objectId] >> 16
|
||||
inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrSourceKey: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getReplicaKey: data fromGlobCnt: [self objectId] >> 16];
|
||||
return [self getReplicaKey: data fromGlobCnt: [self objectId] >> 16
|
||||
inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (uint64_t) objectVersion
|
||||
@@ -357,11 +365,14 @@ static Class NSExceptionK, MAPIStoreFolderK;
|
||||
}
|
||||
|
||||
- (int) getPrChangeKey: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getReplicaKey: data fromGlobCnt: [self objectVersion]];
|
||||
return [self getReplicaKey: data fromGlobCnt: [self objectVersion]
|
||||
inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrChangeNum: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongLongValue (memCtx, ([self objectVersion] << 16) | 0x0001);
|
||||
|
||||
@@ -369,6 +380,7 @@ static Class NSExceptionK, MAPIStoreFolderK;
|
||||
}
|
||||
|
||||
- (int) getPrCreationTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [[self creationTime] asFileTimeInMemCtx: memCtx];
|
||||
|
||||
@@ -376,6 +388,7 @@ static Class NSExceptionK, MAPIStoreFolderK;
|
||||
}
|
||||
|
||||
- (int) getPrLastModificationTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [[self lastModificationTime] asFileTimeInMemCtx: memCtx];
|
||||
|
||||
@@ -383,19 +396,22 @@ static Class NSExceptionK, MAPIStoreFolderK;
|
||||
}
|
||||
|
||||
- (int) getAvailableProperties: (struct SPropTagArray **) propertiesP
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [isa getAvailableProperties: propertiesP];
|
||||
return [isa getAvailableProperties: propertiesP inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getProperties: (struct mapistore_property_data *) data
|
||||
withTags: (enum MAPITAGS *) tags
|
||||
andCount: (uint16_t) columnCount
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
uint16_t count;
|
||||
|
||||
for (count = 0; count < columnCount; count++)
|
||||
data[count].error = [self getProperty: &data[count].data
|
||||
withTag: tags[count]];
|
||||
withTag: tags[count]
|
||||
inMemCtx: memCtx];
|
||||
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
|
||||
+121
-97
@@ -35,6 +35,7 @@
|
||||
#import "MAPIStoreContext.h"
|
||||
#import "MAPIStoreObject.h"
|
||||
#import "MAPIStoreTable.h"
|
||||
#import "NSObject+MAPIStore.h"
|
||||
|
||||
#import "MAPIStoreSOGo.h"
|
||||
|
||||
@@ -208,8 +209,8 @@ sogo_release_record(void *private_data, uint64_t fmid, uint8_t type)
|
||||
\return MAPISTORE_SUCCESS on success, otherwise MAPISTORE error
|
||||
*/
|
||||
static int
|
||||
sogo_get_path(void *private_data, uint64_t fmid,
|
||||
uint8_t type, char **path)
|
||||
sogo_get_path(void *private_data, TALLOC_CTX *mem_ctx,
|
||||
uint64_t fmid, uint8_t type, char **path)
|
||||
{
|
||||
NSAutoreleasePool *pool;
|
||||
sogo_context *cContext;
|
||||
@@ -224,7 +225,7 @@ sogo_get_path(void *private_data, uint64_t fmid,
|
||||
context = cContext->objcContext;
|
||||
[context setupRequest];
|
||||
|
||||
rc = [context getPath: path ofFMID: fmid withTableType: type];
|
||||
rc = [context getPath: path ofFMID: fmid withTableType: type inMemCtx: mem_ctx];
|
||||
|
||||
[context tearDownRequest];
|
||||
|
||||
@@ -428,6 +429,7 @@ sogo_op_readdir_count(void *private_data,
|
||||
|
||||
static int
|
||||
sogo_op_get_table_property(void *private_data,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
uint64_t fid,
|
||||
uint8_t table_type,
|
||||
enum table_query_type query_type,
|
||||
@@ -450,7 +452,7 @@ sogo_op_get_table_property(void *private_data,
|
||||
|
||||
rc = [context getTableProperty: data withTag: proptag atPosition: pos
|
||||
withTableType: table_type andQueryType: query_type
|
||||
inFID: fid];
|
||||
inFID: fid inMemCtx: mem_ctx];
|
||||
|
||||
[context tearDownRequest];
|
||||
[pool release];
|
||||
@@ -459,7 +461,7 @@ sogo_op_get_table_property(void *private_data,
|
||||
}
|
||||
|
||||
static int
|
||||
sogo_op_get_available_table_properties(void *private_data,
|
||||
sogo_op_get_available_table_properties(void *private_data, TALLOC_CTX *mem_ctx,
|
||||
uint8_t type,
|
||||
struct SPropTagArray **propertiesP)
|
||||
{
|
||||
@@ -477,7 +479,8 @@ sogo_op_get_available_table_properties(void *private_data,
|
||||
[context setupRequest];
|
||||
|
||||
rc = [context getAvailableProperties: propertiesP
|
||||
ofTableType: type];
|
||||
ofTableType: type
|
||||
inMemCtx: mem_ctx];
|
||||
|
||||
[context tearDownRequest];
|
||||
[pool release];
|
||||
@@ -487,6 +490,7 @@ sogo_op_get_available_table_properties(void *private_data,
|
||||
|
||||
static int
|
||||
sogo_op_openmessage(void *private_data,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
uint64_t fid,
|
||||
uint64_t mid,
|
||||
struct mapistore_message *msg)
|
||||
@@ -506,7 +510,7 @@ sogo_op_openmessage(void *private_data,
|
||||
|
||||
if (!context)
|
||||
DEBUG (5, (" context data is empty, failure ahead..."));
|
||||
rc = [context openMessage: msg withMID: mid inFID: fid];
|
||||
rc = [context openMessage: msg withMID: mid inFID: fid inMemCtx: mem_ctx];
|
||||
if (rc)
|
||||
DEBUG (5, (" failure opening message\n"));
|
||||
|
||||
@@ -598,7 +602,8 @@ sogo_op_submitmessage(void *private_data,
|
||||
}
|
||||
|
||||
static int
|
||||
sogo_op_getprops(void *private_data,
|
||||
sogo_op_getprops(void *private_data,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
uint64_t fmid,
|
||||
uint8_t type,
|
||||
struct SPropTagArray *SPropTagArray,
|
||||
@@ -620,7 +625,8 @@ sogo_op_getprops(void *private_data,
|
||||
rc = [context getProperties: SPropTagArray
|
||||
ofTableType: type
|
||||
inRow: aRow
|
||||
withMID: fmid];
|
||||
withMID: fmid
|
||||
inMemCtx: mem_ctx];
|
||||
|
||||
[context tearDownRequest];
|
||||
[pool release];
|
||||
@@ -784,13 +790,15 @@ sogo_op_set_sort_order (void *private_data, uint64_t fid, uint8_t type,
|
||||
proof of concept
|
||||
*/
|
||||
static int
|
||||
sogo_pocop_open_table(void *private_data, uint64_t fid, uint8_t table_type,
|
||||
sogo_pocop_open_table(void *private_data, TALLOC_CTX *mem_ctx,
|
||||
uint64_t fid, uint8_t table_type,
|
||||
uint32_t handle_id,
|
||||
void **table_object, uint32_t *row_count)
|
||||
{
|
||||
NSAutoreleasePool *pool;
|
||||
sogo_context *cContext;
|
||||
MAPIStoreContext *context;
|
||||
MAPIStoreTable *table;
|
||||
int rc;
|
||||
|
||||
DEBUG (5, ("[SOGo: %s:%d]\n", __FUNCTION__, __LINE__));
|
||||
@@ -802,11 +810,13 @@ sogo_pocop_open_table(void *private_data, uint64_t fid, uint8_t table_type,
|
||||
if (context)
|
||||
{
|
||||
[context setupRequest];
|
||||
rc = [context getTable: table_object
|
||||
rc = [context getTable: &table
|
||||
andRowCount: row_count
|
||||
withFID: fid
|
||||
tableType: table_type
|
||||
andHandleId: handle_id];
|
||||
if (rc == MAPISTORE_SUCCESS)
|
||||
*table_object = [table tallocWrapper: mem_ctx];
|
||||
[context tearDownRequest];
|
||||
[pool release];
|
||||
}
|
||||
@@ -820,11 +830,12 @@ sogo_pocop_open_table(void *private_data, uint64_t fid, uint8_t table_type,
|
||||
}
|
||||
|
||||
static int
|
||||
sogo_pocop_get_attachment_table (void *private_data, uint64_t mid, void **table_object, uint32_t *row_count)
|
||||
sogo_pocop_get_attachment_table (void *private_data, TALLOC_CTX *mem_ctx, uint64_t mid, void **table_object, uint32_t *row_count)
|
||||
{
|
||||
NSAutoreleasePool *pool;
|
||||
sogo_context *cContext;
|
||||
MAPIStoreContext *context;
|
||||
MAPIStoreAttachmentTable *table;
|
||||
int rc;
|
||||
|
||||
DEBUG (5, ("[SOGo: %s:%d]\n", __FUNCTION__, __LINE__));
|
||||
@@ -836,9 +847,44 @@ sogo_pocop_get_attachment_table (void *private_data, uint64_t mid, void **table_
|
||||
if (context)
|
||||
{
|
||||
[context setupRequest];
|
||||
rc = [context getAttachmentTable: table_object
|
||||
rc = [context getAttachmentTable: &table
|
||||
andRowCount: row_count
|
||||
withMID: mid];
|
||||
*table_object = [table tallocWrapper: mem_ctx];
|
||||
[context tearDownRequest];
|
||||
}
|
||||
else
|
||||
{
|
||||
NSLog (@" UNEXPECTED WEIRDNESS: RECEIVED NO CONTEXT");
|
||||
rc = MAPI_E_NOT_FOUND;
|
||||
}
|
||||
|
||||
[pool release];
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int
|
||||
sogo_pocop_get_attachment (void *private_data, TALLOC_CTX *mem_ctx, uint64_t mid, uint32_t aid, void **attachment_object)
|
||||
{
|
||||
NSAutoreleasePool *pool;
|
||||
sogo_context *cContext;
|
||||
MAPIStoreContext *context;
|
||||
MAPIStoreAttachment *attachment;
|
||||
int rc;
|
||||
|
||||
DEBUG (5, ("[SOGo: %s:%d]\n", __FUNCTION__, __LINE__));
|
||||
|
||||
pool = [NSAutoreleasePool new];
|
||||
|
||||
cContext = private_data;
|
||||
context = cContext->objcContext;
|
||||
if (context)
|
||||
{
|
||||
[context setupRequest];
|
||||
rc = [context getAttachment: &attachment withAID: aid inMID: mid];
|
||||
if (rc == MAPISTORE_SUCCESS)
|
||||
*attachment_object = [attachment tallocWrapper: mem_ctx];
|
||||
[context tearDownRequest];
|
||||
[pool release];
|
||||
}
|
||||
@@ -852,11 +898,12 @@ sogo_pocop_get_attachment_table (void *private_data, uint64_t mid, void **table_
|
||||
}
|
||||
|
||||
static int
|
||||
sogo_pocop_get_attachment (void *private_data, uint64_t mid, uint32_t aid, void **attachment_object)
|
||||
sogo_pocop_create_attachment (void *private_data, TALLOC_CTX *mem_ctx, uint64_t mid, uint32_t *aid, void **attachment_object)
|
||||
{
|
||||
NSAutoreleasePool *pool;
|
||||
sogo_context *cContext;
|
||||
MAPIStoreContext *context;
|
||||
MAPIStoreAttachment *attachment;
|
||||
int rc;
|
||||
|
||||
DEBUG (5, ("[SOGo: %s:%d]\n", __FUNCTION__, __LINE__));
|
||||
@@ -868,37 +915,10 @@ sogo_pocop_get_attachment (void *private_data, uint64_t mid, uint32_t aid, void
|
||||
if (context)
|
||||
{
|
||||
[context setupRequest];
|
||||
rc = [context getAttachment: attachment_object withAID: aid inMID: mid];
|
||||
[context tearDownRequest];
|
||||
[pool release];
|
||||
}
|
||||
else
|
||||
{
|
||||
NSLog (@" UNEXPECTED WEIRDNESS: RECEIVED NO CONTEXT");
|
||||
rc = MAPI_E_NOT_FOUND;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int
|
||||
sogo_pocop_create_attachment (void *private_data, uint64_t mid, uint32_t *aid, void **attachment_object)
|
||||
{
|
||||
NSAutoreleasePool *pool;
|
||||
sogo_context *cContext;
|
||||
MAPIStoreContext *context;
|
||||
int rc;
|
||||
|
||||
DEBUG (5, ("[SOGo: %s:%d]\n", __FUNCTION__, __LINE__));
|
||||
|
||||
pool = [NSAutoreleasePool new];
|
||||
|
||||
cContext = private_data;
|
||||
context = cContext->objcContext;
|
||||
if (context)
|
||||
{
|
||||
[context setupRequest];
|
||||
rc = [context createAttachment: attachment_object inAID: aid withMessage: mid];
|
||||
rc = [context createAttachment: &attachment inAID: aid
|
||||
withMessage: mid];
|
||||
if (rc == MAPISTORE_SUCCESS)
|
||||
*attachment_object = [attachment tallocWrapper: mem_ctx];
|
||||
[context tearDownRequest];
|
||||
[pool release];
|
||||
}
|
||||
@@ -913,11 +933,14 @@ sogo_pocop_create_attachment (void *private_data, uint64_t mid, uint32_t *aid, v
|
||||
|
||||
static int
|
||||
sogo_pocop_open_embedded_message (void *attachment_object,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
uint64_t *mid, enum OpenEmbeddedMessage_OpenModeFlags flags,
|
||||
struct mapistore_message *msg, void **message_object)
|
||||
{
|
||||
struct MAPIStoreTallocWrapper *wrapper;
|
||||
NSAutoreleasePool *pool;
|
||||
MAPIStoreAttachment *attachment;
|
||||
MAPIStoreAttachmentMessage *message;
|
||||
int rc;
|
||||
|
||||
DEBUG (5, ("[SOGo: %s:%d]\n", __FUNCTION__, __LINE__));
|
||||
@@ -926,11 +949,14 @@ sogo_pocop_open_embedded_message (void *attachment_object,
|
||||
|
||||
if (attachment_object)
|
||||
{
|
||||
attachment = attachment_object;
|
||||
wrapper = attachment_object;
|
||||
attachment = wrapper->MAPIStoreSOGoObject;
|
||||
pool = [NSAutoreleasePool new];
|
||||
rc = [attachment openEmbeddedMessage: message_object
|
||||
rc = [attachment openEmbeddedMessage: &message
|
||||
withMID: mid
|
||||
withMAPIStoreMsg: msg andFlags: flags];
|
||||
if (rc == MAPISTORE_SUCCESS)
|
||||
*message_object = [message tallocWrapper: mem_ctx];
|
||||
[pool release];
|
||||
}
|
||||
else
|
||||
@@ -942,19 +968,22 @@ sogo_pocop_open_embedded_message (void *attachment_object,
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int sogo_pocop_get_available_table_properties(void *table_object, struct SPropTagArray **propertiesP)
|
||||
static int sogo_pocop_get_available_table_properties(void *table_object,
|
||||
TALLOC_CTX *mem_ctx, struct SPropTagArray **propertiesP)
|
||||
{
|
||||
struct MAPIStoreTallocWrapper *wrapper;
|
||||
NSAutoreleasePool *pool;
|
||||
MAPIStoreTable *table;
|
||||
int rc;
|
||||
|
||||
DEBUG (5, ("[SOGo: %s:%d]\n", __FUNCTION__, __LINE__));
|
||||
|
||||
table = table_object;
|
||||
if (table)
|
||||
if (table_object)
|
||||
{
|
||||
wrapper = table_object;
|
||||
table = wrapper->MAPIStoreSOGoObject;
|
||||
pool = [NSAutoreleasePool new];
|
||||
rc = [table getAvailableProperties: propertiesP];
|
||||
rc = [table getAvailableProperties: propertiesP inMemCtx: mem_ctx];
|
||||
[pool release];
|
||||
}
|
||||
else
|
||||
@@ -969,15 +998,17 @@ static int sogo_pocop_get_available_table_properties(void *table_object, struct
|
||||
static int
|
||||
sogo_pocop_set_table_columns (void *table_object, uint16_t count, enum MAPITAGS *properties)
|
||||
{
|
||||
struct MAPIStoreTallocWrapper *wrapper;
|
||||
NSAutoreleasePool *pool;
|
||||
MAPIStoreTable *table;
|
||||
int rc;
|
||||
|
||||
DEBUG (5, ("[SOGo: %s:%d]\n", __FUNCTION__, __LINE__));
|
||||
|
||||
table = table_object;
|
||||
if (table)
|
||||
if (table_object)
|
||||
{
|
||||
wrapper = table_object;
|
||||
table = wrapper->MAPIStoreSOGoObject;
|
||||
pool = [NSAutoreleasePool new];
|
||||
rc = [table setColumns: properties
|
||||
withCount: count];
|
||||
@@ -995,15 +1026,17 @@ sogo_pocop_set_table_columns (void *table_object, uint16_t count, enum MAPITAGS
|
||||
static int
|
||||
sogo_pocop_set_table_restrictions (void *table_object, struct mapi_SRestriction *restrictions, uint8_t *table_status)
|
||||
{
|
||||
struct MAPIStoreTallocWrapper *wrapper;
|
||||
NSAutoreleasePool *pool;
|
||||
MAPIStoreTable *table;
|
||||
int rc;
|
||||
|
||||
DEBUG (5, ("[SOGo: %s:%d]\n", __FUNCTION__, __LINE__));
|
||||
|
||||
table = table_object;
|
||||
if (table)
|
||||
if (table_object)
|
||||
{
|
||||
wrapper = table_object;
|
||||
table = wrapper->MAPIStoreSOGoObject;
|
||||
pool = [NSAutoreleasePool new];
|
||||
[table setRestrictions: restrictions];
|
||||
[table cleanupCaches];
|
||||
@@ -1023,15 +1056,17 @@ sogo_pocop_set_table_restrictions (void *table_object, struct mapi_SRestriction
|
||||
static int
|
||||
sogo_pocop_set_table_sort_order (void *table_object, struct SSortOrderSet *sort_order, uint8_t *table_status)
|
||||
{
|
||||
struct MAPIStoreTallocWrapper *wrapper;
|
||||
NSAutoreleasePool *pool;
|
||||
MAPIStoreTable *table;
|
||||
int rc;
|
||||
|
||||
DEBUG (5, ("[SOGo: %s:%d]\n", __FUNCTION__, __LINE__));
|
||||
|
||||
table = table_object;
|
||||
if (table)
|
||||
if (table_object)
|
||||
{
|
||||
wrapper = table_object;
|
||||
table = wrapper->MAPIStoreSOGoObject;
|
||||
pool = [NSAutoreleasePool new];
|
||||
[table setSortOrder: sort_order];
|
||||
[table cleanupCaches];
|
||||
@@ -1049,19 +1084,24 @@ sogo_pocop_set_table_sort_order (void *table_object, struct SSortOrderSet *sort_
|
||||
}
|
||||
|
||||
static int
|
||||
sogo_pocop_get_table_row (void *table_object, enum table_query_type query_type, uint32_t row_id, struct mapistore_property_data *data)
|
||||
sogo_pocop_get_table_row (void *table_object, TALLOC_CTX *mem_ctx,
|
||||
enum table_query_type query_type, uint32_t row_id,
|
||||
struct mapistore_property_data *data)
|
||||
{
|
||||
struct MAPIStoreTallocWrapper *wrapper;
|
||||
NSAutoreleasePool *pool;
|
||||
MAPIStoreTable *table;
|
||||
int rc;
|
||||
|
||||
DEBUG (5, ("[SOGo: %s:%d]\n", __FUNCTION__, __LINE__));
|
||||
|
||||
table = table_object;
|
||||
if (table)
|
||||
if (table_object)
|
||||
{
|
||||
wrapper = table_object;
|
||||
table = wrapper->MAPIStoreSOGoObject;
|
||||
pool = [NSAutoreleasePool new];
|
||||
rc = [table getRow: data withRowID: row_id andQueryType: query_type];
|
||||
rc = [table getRow: data withRowID: row_id andQueryType: query_type
|
||||
inMemCtx: mem_ctx];
|
||||
[pool release];
|
||||
}
|
||||
else
|
||||
@@ -1073,19 +1113,23 @@ sogo_pocop_get_table_row (void *table_object, enum table_query_type query_type,
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int sogo_pocop_get_available_properties(void *object, struct SPropTagArray **propertiesP)
|
||||
static int sogo_pocop_get_available_properties(void *object,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
struct SPropTagArray **propertiesP)
|
||||
{
|
||||
struct MAPIStoreTallocWrapper *wrapper;
|
||||
NSAutoreleasePool *pool;
|
||||
MAPIStoreObject *propObject;
|
||||
int rc;
|
||||
|
||||
DEBUG (5, ("[SOGo: %s:%d]\n", __FUNCTION__, __LINE__));
|
||||
|
||||
propObject = object;
|
||||
if (propObject)
|
||||
if (object)
|
||||
{
|
||||
wrapper = object;
|
||||
propObject = wrapper->MAPIStoreSOGoObject;
|
||||
pool = [NSAutoreleasePool new];
|
||||
rc = [propObject getAvailableProperties: propertiesP];
|
||||
rc = [propObject getAvailableProperties: propertiesP inMemCtx: mem_ctx];
|
||||
[pool release];
|
||||
}
|
||||
else
|
||||
@@ -1099,20 +1143,25 @@ static int sogo_pocop_get_available_properties(void *object, struct SPropTagArra
|
||||
|
||||
static int
|
||||
sogo_pocop_get_properties (void *object,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
uint16_t count, enum MAPITAGS *properties,
|
||||
struct mapistore_property_data *data)
|
||||
{
|
||||
struct MAPIStoreTallocWrapper *wrapper;
|
||||
NSAutoreleasePool *pool;
|
||||
MAPIStoreObject *propObject;
|
||||
int rc;
|
||||
|
||||
DEBUG (5, ("[SOGo: %s:%d]\n", __FUNCTION__, __LINE__));
|
||||
|
||||
propObject = object;
|
||||
if (propObject)
|
||||
if (object)
|
||||
{
|
||||
wrapper = object;
|
||||
propObject = wrapper->MAPIStoreSOGoObject;
|
||||
pool = [NSAutoreleasePool new];
|
||||
rc = [propObject getProperties: data withTags: properties andCount: count];
|
||||
rc = [propObject getProperties: data withTags: properties
|
||||
andCount: count
|
||||
inMemCtx: mem_ctx];
|
||||
[pool release];
|
||||
}
|
||||
else
|
||||
@@ -1127,15 +1176,17 @@ sogo_pocop_get_properties (void *object,
|
||||
static int
|
||||
sogo_pocop_set_properties (void *object, struct SRow *aRow)
|
||||
{
|
||||
struct MAPIStoreTallocWrapper *wrapper;
|
||||
NSAutoreleasePool *pool;
|
||||
MAPIStoreObject *propObject;
|
||||
int rc;
|
||||
|
||||
DEBUG (5, ("[SOGo: %s:%d]\n", __FUNCTION__, __LINE__));
|
||||
|
||||
propObject = object;
|
||||
if (propObject)
|
||||
if (object)
|
||||
{
|
||||
wrapper = object;
|
||||
propObject = wrapper->MAPIStoreSOGoObject;
|
||||
pool = [NSAutoreleasePool new];
|
||||
rc = [propObject setProperties: aRow];
|
||||
[pool release];
|
||||
@@ -1149,32 +1200,6 @@ sogo_pocop_set_properties (void *object, struct SRow *aRow)
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int
|
||||
sogo_pocop_release (void *object)
|
||||
{
|
||||
NSAutoreleasePool *pool;
|
||||
MAPIStoreObject *propObject;
|
||||
int rc;
|
||||
|
||||
DEBUG (5, ("[SOGo: %s:%d]\n", __FUNCTION__, __LINE__));
|
||||
|
||||
propObject = object;
|
||||
if (propObject)
|
||||
{
|
||||
pool = [NSAutoreleasePool new];
|
||||
[propObject release];
|
||||
[pool release];
|
||||
rc = MAPI_E_SUCCESS;
|
||||
}
|
||||
else
|
||||
{
|
||||
NSLog (@" UNEXPECTED WEIRDNESS: RECEIVED NO DATA");
|
||||
rc = MAPI_E_NOT_FOUND;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/**
|
||||
\details Entry point for mapistore SOGO backend
|
||||
|
||||
@@ -1238,7 +1263,6 @@ int mapistore_init_backend(void)
|
||||
backend.properties.get_available_properties = sogo_pocop_get_available_properties;
|
||||
backend.properties.get_properties = sogo_pocop_get_properties;
|
||||
backend.properties.set_properties = sogo_pocop_set_properties;
|
||||
backend.store.release = sogo_pocop_release;
|
||||
|
||||
/* Register ourselves with the MAPISTORE subsystem */
|
||||
ret = mapistore_backend_register(&backend);
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
#ifndef MAPISTORETABLE_H
|
||||
#define MAPISTORETABLE_H
|
||||
|
||||
#include <talloc.h>
|
||||
|
||||
#import <Foundation/NSObject.h>
|
||||
|
||||
#define SENSITIVITY_NONE 0
|
||||
@@ -85,13 +87,15 @@ typedef enum {
|
||||
|
||||
- (void) cleanupCaches;
|
||||
|
||||
- (int) getAvailableProperties: (struct SPropTagArray **) propertiesP;
|
||||
- (int) getAvailableProperties: (struct SPropTagArray **) propertiesP
|
||||
inMemCtx: (TALLOC_CTX *) localMemCtx;
|
||||
- (void) setRestrictions: (const struct mapi_SRestriction *) res;
|
||||
- (int) setColumns: (enum MAPITAGS *) newColumns
|
||||
withCount: (uint16_t) newColumCount;
|
||||
- (int) getRow: (struct mapistore_property_data *) data
|
||||
withRowID: (uint32_t) rowId
|
||||
andQueryType: (enum table_query_type) queryType;
|
||||
andQueryType: (enum table_query_type) queryType
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
|
||||
- (void) notifyChangesForChild: (MAPIStoreObject *) child;
|
||||
|
||||
|
||||
@@ -376,8 +376,10 @@ static Class NSDataK, NSStringK;
|
||||
}
|
||||
|
||||
- (int) getAvailableProperties: (struct SPropTagArray **) propertiesP
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [[isa childObjectClass] getAvailableProperties: propertiesP];
|
||||
return [[isa childObjectClass] getAvailableProperties: propertiesP
|
||||
inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (void) setRestrictions: (const struct mapi_SRestriction *) res
|
||||
@@ -804,6 +806,7 @@ static Class NSDataK, NSStringK;
|
||||
- (int) getRow: (struct mapistore_property_data *) data
|
||||
withRowID: (uint32_t) rowId
|
||||
andQueryType: (enum table_query_type) queryType
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSUInteger count;
|
||||
MAPIStoreObject *child;
|
||||
@@ -816,7 +819,8 @@ static Class NSDataK, NSStringK;
|
||||
rc = MAPI_E_SUCCESS;
|
||||
for (count = 0; count < columnsCount; count++)
|
||||
data[count].error = [child getProperty: &data[count].data
|
||||
withTag: columns[count]];
|
||||
withTag: columns[count]
|
||||
inMemCtx: memCtx];
|
||||
}
|
||||
else
|
||||
rc = MAPI_E_INVALID_OBJECT;
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
@implementation MAPIStoreTasksMessage
|
||||
|
||||
- (int) getPrIconIndex: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
/* see http://msdn.microsoft.com/en-us/library/cc815472.aspx */
|
||||
// Unassigned recurring task 0x00000501
|
||||
@@ -64,6 +65,7 @@
|
||||
}
|
||||
|
||||
- (int) getPrMessageClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = talloc_strdup(memCtx, "IPM.Task");
|
||||
|
||||
@@ -71,6 +73,7 @@
|
||||
}
|
||||
|
||||
- (int) getPrSubject: (void **) data // SUMMARY
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
iCalToDo *task;
|
||||
|
||||
@@ -81,6 +84,7 @@
|
||||
}
|
||||
|
||||
- (int) getPrImportance: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
uint32_t v;
|
||||
iCalToDo *task;
|
||||
@@ -99,6 +103,7 @@
|
||||
}
|
||||
|
||||
- (int) getPidLidTaskComplete: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
iCalToDo *task;
|
||||
|
||||
@@ -110,6 +115,7 @@
|
||||
}
|
||||
|
||||
- (int) getPidLidPercentComplete: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
double doubleValue;
|
||||
iCalToDo *task;
|
||||
@@ -123,6 +129,7 @@
|
||||
}
|
||||
|
||||
- (int) getPidLidTaskDateCompleted: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
int rc = MAPISTORE_SUCCESS;
|
||||
NSCalendarDate *dateValue;
|
||||
@@ -140,6 +147,7 @@
|
||||
}
|
||||
|
||||
- (int) getPidLidTaskState: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, 0x1); // not assigned
|
||||
|
||||
@@ -147,36 +155,43 @@
|
||||
}
|
||||
|
||||
- (int) getPidLidTaskMode: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getLongZero: data];
|
||||
return [self getLongZero: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidTaskFRecurring: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getNo: data];
|
||||
return [self getNo: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidTaskAccepted: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getNo: data];
|
||||
return [self getNo: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidTaskActualEffort: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getLongZero: data];
|
||||
return [self getLongZero: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidTaskEstimatedEffort: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getLongZero: data];
|
||||
return [self getLongZero: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPrHasattach: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getNo: data];
|
||||
return [self getNo: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidTaskDueDate: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
int rc = MAPISTORE_SUCCESS;
|
||||
NSCalendarDate *dateValue;
|
||||
@@ -193,21 +208,25 @@
|
||||
}
|
||||
|
||||
- (int) getPrMessageDeliveryTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPrLastModificationTime: data];
|
||||
return [self getPrLastModificationTime: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getClientSubmitTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPrLastModificationTime: data];
|
||||
return [self getPrLastModificationTime: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getLocalCommitTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPrLastModificationTime: data];
|
||||
return [self getPrLastModificationTime: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidTaskStatus: (void **) data // status
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *status;
|
||||
uint32_t longValue;
|
||||
@@ -230,6 +249,7 @@
|
||||
}
|
||||
|
||||
- (int) getPidLidTaskOwner: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [@"openchange@example.com" asUnicodeInMemCtx: memCtx];
|
||||
|
||||
@@ -237,8 +257,9 @@
|
||||
}
|
||||
|
||||
- (int) getPidLidTaskOwnership: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getLongZero: data];
|
||||
return [self getLongZero: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (void) save
|
||||
|
||||
@@ -27,6 +27,17 @@
|
||||
|
||||
#include <talloc.h>
|
||||
|
||||
struct MAPIStoreTallocWrapper
|
||||
{
|
||||
id MAPIStoreSOGoObject;
|
||||
};
|
||||
|
||||
@interface NSObject (MAPIStoreTallocHelpers)
|
||||
|
||||
- (struct MAPIStoreTallocWrapper *) tallocWrapper: (TALLOC_CTX *) tallocCtx;
|
||||
|
||||
@end
|
||||
|
||||
@interface NSObject (MAPIStoreDataTypes)
|
||||
|
||||
- (enum MAPISTATUS) getMAPIValue: (void **) data
|
||||
|
||||
@@ -32,6 +32,34 @@
|
||||
#undef DEBUG
|
||||
#include <mapistore/mapistore.h>
|
||||
|
||||
@implementation NSObject (MAPIStoreTallocHelpers)
|
||||
|
||||
static int MAPIStoreTallocWrapperDestroy (void *data)
|
||||
{
|
||||
struct MAPIStoreTallocWrapper *wrapper;
|
||||
|
||||
wrapper = data;
|
||||
NSLog (@"destroying wrapped object (wrapper: %p; object: %p...\n", wrapper, wrapper->MAPIStoreSOGoObject);
|
||||
[wrapper->MAPIStoreSOGoObject release];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
- (struct MAPIStoreTallocWrapper *) tallocWrapper: (TALLOC_CTX *) tallocCtx
|
||||
{
|
||||
struct MAPIStoreTallocWrapper *wrapper;
|
||||
|
||||
wrapper = talloc_zero (tallocCtx, struct MAPIStoreTallocWrapper);
|
||||
wrapper->MAPIStoreSOGoObject = self;
|
||||
[wrapper->MAPIStoreSOGoObject retain];
|
||||
talloc_set_destructor ((void *) wrapper, MAPIStoreTallocWrapperDestroy);
|
||||
NSLog (@"returning wrapper: %p; object: %p", wrapper, self);
|
||||
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSObject (MAPIStoreDataTypes)
|
||||
|
||||
- (enum MAPISTATUS) getMAPIValue: (void **) data
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
typedef int (*MAPIStorePropertyGetter) (id inst, SEL _cmd, void **data);
|
||||
typedef int (*MAPIStorePropertyGetter) (id inst, SEL _cmd,
|
||||
void **data, TALLOC_CTX *memCtx);
|
||||
|
||||
const MAPIStorePropertyGetter *MAPIStorePropertyGettersForClass (Class klass);
|
||||
SEL MAPIStoreSelectorForPropertyGetter (uint16_t propertyId);
|
||||
|
||||
@@ -253,9 +253,9 @@ if __name__ == "__main__":
|
||||
getters_idx[prop_idx] = " 0x%.4x" % current_getter_idx
|
||||
if prop_idx > highest_prop_idx:
|
||||
highest_prop_idx = prop_idx
|
||||
getters.append(" @selector (get%s:)" % name)
|
||||
getters.append(" @selector (get%s:inMemCtx:)" % name)
|
||||
# preferred_types.append(" 0x%.4x" % (prop_tag & 0xffff))
|
||||
prototypes.append("- (int) get%s: (void **) data;" % name)
|
||||
prototypes.append("- (int) get%s: (void **) data inMemCtx: (TALLOC_CTX *) memCtx;" % name)
|
||||
current_getter_idx = current_getter_idx + 1
|
||||
# setters[prop_idx] = " @selector (set%s:)" % name
|
||||
# prototypes.append("- (int) set%s: (void **) data;" % name)
|
||||
|
||||
Reference in New Issue
Block a user