(fix) integrated latest OC changes
parent
bd0ff6043c
commit
4a74f00adb
|
@ -78,6 +78,9 @@ $(SOGOBACKEND)_OBJC_FILES += \
|
|||
MAPIStoreGCSMessage.m \
|
||||
MAPIStoreGCSMessageTable.m \
|
||||
\
|
||||
MAPIStoreCalTaskFolder.m \
|
||||
MAPIStoreCalTaskMessage.m \
|
||||
\
|
||||
MAPIStoreCalendarAttachment.m \
|
||||
MAPIStoreCalendarContext.m \
|
||||
MAPIStoreCalendarFolder.m \
|
||||
|
|
|
@ -68,105 +68,109 @@
|
|||
- (void) fillMessageData: (struct mapistore_message *) dataPtr
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
|
||||
- (int) getPidTagSenderEmailAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidTagSenderAddressType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidTagSenderName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidTagSenderEntryId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (NSString *) creator;
|
||||
- (NSString *) owner;
|
||||
- (NSUInteger) sensitivity;
|
||||
|
||||
- (int) getPidTagReceivedByAddressType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidTagReceivedByEmailAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidTagReceivedByName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidTagReceivedByEntryId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidTagSenderEmailAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidTagSenderAddressType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidTagSenderName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidTagSenderEntryId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
|
||||
- (int) getPidTagIconIndex: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidTagOwnerAppointmentId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidMeetingType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidTagMessageClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidTagStartDate: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidAppointmentSequence: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidAppointmentStateFlags: (void **) data
|
||||
- (enum mapistore_error) getPidTagReceivedByAddressType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidTagReceivedByEmailAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidTagReceivedByName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidTagReceivedByEntryId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
|
||||
- (enum mapistore_error) getPidTagIconIndex: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidTagOwnerAppointmentId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidMeetingType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidTagMessageClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidTagStartDate: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidAppointmentSequence: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidAppointmentStateFlags: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidResponseStatus: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
|
||||
- (enum mapistore_error) getPidLidAppointmentStartWhole: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidCommonStart: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidTagEndDate: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidAppointmentEndWhole: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidCommonEnd: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidAppointmentDuration: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidAppointmentSubType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidBusyStatus: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidIndentedBusyStatus: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidTagNormalizedSubject: (void **) data // SUMMARY
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidLocation: (void **) data // LOCATION
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidPrivate: (void **) data // private (bool), should depend on CLASS and permissions
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidTagSensitivity: (void **) data // not implemented, depends on CLASS
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidTagImportance: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidTagBody: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidResponseStatus: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
|
||||
- (int) getPidLidAppointmentStartWhole: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidCommonStart: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidTagEndDate: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidAppointmentEndWhole: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidCommonEnd: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidAppointmentDuration: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidAppointmentSubType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidBusyStatus: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidIndentedBusyStatus: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidTagNormalizedSubject: (void **) data // SUMMARY
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidLocation: (void **) data // LOCATION
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidPrivate: (void **) data // private (bool), should depend on CLASS and permissions
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidTagSensitivity: (void **) data // not implemented, depends on CLASS
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidTagImportance: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidTagBody: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidIsRecurring: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidRecurring: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidAppointmentRecur: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidGlobalObjectId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidCleanGlobalObjectId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidServerProcessed: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidServerProcessingActions: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidAppointmentReplyTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidIsRecurring: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidRecurring: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidAppointmentRecur: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidGlobalObjectId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidCleanGlobalObjectId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidServerProcessed: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidServerProcessingActions: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidAppointmentReplyTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
|
||||
/* reminders */
|
||||
- (int) getPidLidReminderSet: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidReminderDelta: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidReminderTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidReminderSignalTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidReminderOverride: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidReminderType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidReminderPlaySound: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidReminderFileParameter: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidReminderSet: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidReminderDelta: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidReminderTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidReminderSignalTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidReminderOverride: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidReminderType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidReminderPlaySound: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidReminderFileParameter: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
|
||||
@end
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -36,13 +36,13 @@
|
|||
- (void) setAID: (uint32_t) newAID;
|
||||
- (uint32_t) AID;
|
||||
|
||||
- (int) openEmbeddedMessage: (MAPIStoreEmbeddedMessage **) messagePtr
|
||||
withMID: (uint64_t *) mid
|
||||
withMAPIStoreMsg: (struct mapistore_message **) mapistoreMsgPtr
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) createEmbeddedMessage: (MAPIStoreEmbeddedMessage **) messagePtr
|
||||
withMAPIStoreMsg: (struct mapistore_message **) mapistoreMsgPtr
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) openEmbeddedMessage: (MAPIStoreEmbeddedMessage **) messagePtr
|
||||
withMID: (uint64_t *) mid
|
||||
withMAPIStoreMsg: (struct mapistore_message **) mapistoreMsgPtr
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) createEmbeddedMessage: (MAPIStoreEmbeddedMessage **) messagePtr
|
||||
withMAPIStoreMsg: (struct mapistore_message **) mapistoreMsgPtr
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
|
||||
/* helpers */
|
||||
- (NSData *) mimeAttachTag;
|
||||
|
|
|
@ -67,40 +67,40 @@
|
|||
return mimeAttachTag;
|
||||
}
|
||||
|
||||
- (int) getPidTagMid: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagMid: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongLongValue (memCtx, [container objectId]);
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagAttachNumber: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagAttachNumber: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, aid);
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagRenderingPosition: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagRenderingPosition: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, 0xffffffff);
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagAccessLevel: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagAccessLevel: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getLongZero: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) openEmbeddedMessage: (MAPIStoreEmbeddedMessage **) messagePtr
|
||||
withMID: (uint64_t *) mid
|
||||
withMAPIStoreMsg: (struct mapistore_message **) mapistoreMsgPtr
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) openEmbeddedMessage: (MAPIStoreEmbeddedMessage **) messagePtr
|
||||
withMID: (uint64_t *) mid
|
||||
withMAPIStoreMsg: (struct mapistore_message **) mapistoreMsgPtr
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
MAPIStoreEmbeddedMessage *attMessage;
|
||||
struct mapistore_message *mapistoreMsg;
|
||||
|
@ -118,9 +118,9 @@
|
|||
return (attMessage ? MAPISTORE_SUCCESS : MAPISTORE_ERROR);
|
||||
}
|
||||
|
||||
- (int) createEmbeddedMessage: (MAPIStoreEmbeddedMessage **) messagePtr
|
||||
withMAPIStoreMsg: (struct mapistore_message **) mapistoreMsgPtr
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) createEmbeddedMessage: (MAPIStoreEmbeddedMessage **) messagePtr
|
||||
withMAPIStoreMsg: (struct mapistore_message **) mapistoreMsgPtr
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
MAPIStoreEmbeddedMessage *attMessage;
|
||||
struct mapistore_message *mapistoreMsg;
|
||||
|
|
|
@ -94,64 +94,64 @@
|
|||
flattenedValuesForKey: @""];
|
||||
}
|
||||
|
||||
- (int) getPidTagAttachmentHidden: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) localMemCtx
|
||||
- (enum mapistore_error) getPidTagAttachmentHidden: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) localMemCtx
|
||||
{
|
||||
return [self getYes: data inMemCtx: localMemCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagAttachmentFlags: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) localMemCtx
|
||||
- (enum mapistore_error) getPidTagAttachmentFlags: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) localMemCtx
|
||||
{
|
||||
*data = MAPILongValue (localMemCtx, 0x00000002); /* afException */
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagAttachmentLinkId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) localMemCtx
|
||||
- (enum mapistore_error) getPidTagAttachmentLinkId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) localMemCtx
|
||||
{
|
||||
return [self getLongZero: data inMemCtx: localMemCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagAttachFlags: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) localMemCtx
|
||||
- (enum mapistore_error) getPidTagAttachFlags: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) localMemCtx
|
||||
{
|
||||
return [self getLongZero: data inMemCtx: localMemCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagAttachMethod: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) localMemCtx
|
||||
- (enum mapistore_error) getPidTagAttachMethod: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) localMemCtx
|
||||
{
|
||||
*data = MAPILongValue (localMemCtx, afEmbeddedMessage);
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagAttachEncoding: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) localMemCtx
|
||||
- (enum mapistore_error) getPidTagAttachEncoding: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) localMemCtx
|
||||
{
|
||||
*data = [[NSData data] asBinaryInMemCtx: localMemCtx];
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagDisplayName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) localMemCtx
|
||||
- (enum mapistore_error) getPidTagDisplayName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) localMemCtx
|
||||
{
|
||||
*data = [@"Untitled" asUnicodeInMemCtx: localMemCtx];
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagAttachmentContactPhoto: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagAttachmentContactPhoto: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getNo: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagExceptionReplaceTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagExceptionReplaceTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
enum mapistore_error rc;
|
||||
NSCalendarDate *dateValue;
|
||||
|
@ -178,8 +178,8 @@
|
|||
return rc;
|
||||
}
|
||||
|
||||
- (int) getPidTagExceptionStartTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) localMemCtx
|
||||
- (enum mapistore_error) getPidTagExceptionStartTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) localMemCtx
|
||||
{
|
||||
enum mapistore_error rc;
|
||||
NSCalendarDate *dateValue;
|
||||
|
@ -205,8 +205,8 @@
|
|||
return rc;
|
||||
}
|
||||
|
||||
- (int) getPidTagExceptionEndTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) localMemCtx
|
||||
- (enum mapistore_error) getPidTagExceptionEndTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) localMemCtx
|
||||
{
|
||||
enum mapistore_error rc;
|
||||
NSCalendarDate *dateValue;
|
||||
|
|
|
@ -89,73 +89,73 @@
|
|||
*dataPtr = msgData;
|
||||
}
|
||||
|
||||
- (int) getPidTagMessageClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagMessageClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = talloc_strdup (memCtx, "IPM.OLE.CLASS.{00061055-0000-0000-C000-000000000046}");
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagMessageFlags: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagMessageFlags: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, MSGFLAG_UNMODIFIED);
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagProcessed: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagProcessed: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getYes: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagResponseRequested: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagResponseRequested: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getYes: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
/* discarded properties */
|
||||
|
||||
- (int) getPidLidAppointmentLastSequence: (void **)
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidAppointmentLastSequence: (void **)
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
- (int) getPidLidMeetingWorkspaceUrl: (void **)
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidMeetingWorkspaceUrl: (void **)
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
- (int) getPidLidContacts: (void **)
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidContacts: (void **)
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
- (int) getPidTagSensitivity: (void **)
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagSensitivity: (void **)
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
- (int) getPidLidPrivate: (void **)
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidPrivate: (void **)
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
- (int) getPidNameKeywords: (void **)
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidNameKeywords: (void **)
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
- (int) getPidLidFExceptionalBody: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidFExceptionalBody: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getNo: data inMemCtx: memCtx];
|
||||
}
|
||||
|
@ -208,6 +208,7 @@
|
|||
[[container event] updateFromMAPIProperties: properties
|
||||
inUserContext: [self userContext]
|
||||
withActiveUser: activeUser
|
||||
isNew: NO
|
||||
inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
#ifndef MAPISTORECALENDARFOLDER_H
|
||||
#define MAPISTORECALENDARFOLDER_H
|
||||
|
||||
#import "MAPIStoreGCSFolder.h"
|
||||
#import "MAPIStoreCalTaskFolder.h"
|
||||
|
||||
@interface MAPIStoreCalendarFolder : MAPIStoreGCSFolder
|
||||
@interface MAPIStoreCalendarFolder : MAPIStoreCalTaskFolder
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -81,11 +81,7 @@
|
|||
|
||||
Following rights are not supported by SOGo specifically:
|
||||
|
||||
- DeleteOwned : Delete only own objects
|
||||
- EditOwned : Edit only own objects
|
||||
- CreateSubfolders: No calendar subfolders
|
||||
- FolderOwner: No sharing folder ownership?
|
||||
- FolderContact: No support to store this information
|
||||
- FolderVisible: It is inferred by other rights when extracting
|
||||
*/
|
||||
NSMutableArray *roles;
|
||||
|
@ -95,26 +91,35 @@
|
|||
[roles addObject: SOGoRole_ObjectCreator];
|
||||
if (rights & RightsDeleteAll)
|
||||
[roles addObject: SOGoRole_ObjectEraser];
|
||||
if (rights & RightsDeleteOwn)
|
||||
[roles addObject: MAPIStoreRightDeleteOwn];
|
||||
|
||||
if (rights & RightsEditAll)
|
||||
{
|
||||
[roles addObject: SOGoCalendarRole_PublicModifier];
|
||||
[roles addObject: SOGoCalendarRole_PrivateModifier];
|
||||
[roles addObject: SOGoCalendarRole_ConfidentialModifier];
|
||||
}
|
||||
else if (rights & RightsReadItems)
|
||||
if (rights & RightsEditOwn)
|
||||
[roles addObject: MAPIStoreRightEditOwn];
|
||||
|
||||
if (rights & RightsReadItems)
|
||||
{
|
||||
[roles addObject: SOGoCalendarRole_PublicViewer];
|
||||
[roles addObject: SOGoCalendarRole_PrivateViewer];
|
||||
[roles addObject: SOGoCalendarRole_ConfidentialViewer];
|
||||
}
|
||||
if (rights & RightsFreeBusySimple)
|
||||
{
|
||||
[roles addObject: SOGoCalendarRole_PublicDAndTViewer];
|
||||
}
|
||||
[roles addObject: SOGoCalendarRole_PublicDAndTViewer];
|
||||
|
||||
if (rights & RightsFreeBusyDetailed)
|
||||
{
|
||||
[roles addObject: SOGoCalendarRole_ConfidentialDAndTViewer];
|
||||
}
|
||||
[roles addObject: SOGoCalendarRole_ConfidentialDAndTViewer];
|
||||
|
||||
if (rights & RightsFolderOwner)
|
||||
[roles addObject: MAPIStoreRightFolderOwner];
|
||||
|
||||
if (rights & RightsFolderContact)
|
||||
[roles addObject: MAPIStoreRightFolderContact];
|
||||
|
||||
// [self logWithFormat: @"roles for rights %.8x = (%@)", rights, roles];
|
||||
|
||||
|
@ -136,19 +141,28 @@
|
|||
else if ([roles containsObject: SOGoCalendarRole_PublicViewer]
|
||||
&& [roles containsObject: SOGoCalendarRole_PrivateViewer]
|
||||
&& [roles containsObject: SOGoCalendarRole_ConfidentialViewer])
|
||||
// We have to set by hand other rights as only the highest role is returned
|
||||
// See SOGoAppointmentFolder.m:aclsForUser for details
|
||||
rights |= RightsReadItems | RightsFreeBusySimple | RightsFreeBusyDetailed;
|
||||
rights |= RightsReadItems;
|
||||
|
||||
if ([roles containsObject: MAPIStoreRightEditOwn])
|
||||
rights |= RightsEditOwn;
|
||||
if ([roles containsObject: MAPIStoreRightDeleteOwn])
|
||||
rights |= RightsDeleteOwn;
|
||||
|
||||
if ([roles containsObject: SOGoCalendarRole_PublicDAndTViewer])
|
||||
rights |= RightsFreeBusySimple;
|
||||
|
||||
if ([roles containsObject: SOGoCalendarRole_ConfidentialDAndTViewer])
|
||||
rights |= RightsFreeBusyDetailed;
|
||||
rights |= RightsFreeBusySimple | RightsFreeBusyDetailed;
|
||||
|
||||
if ((rights & RightsReadItems) != 0 || (rights & RightsCreateItems) != 0 || (rights & RightsDeleteAll) != 0)
|
||||
rights |= RoleNone; /* actually "folder visible" */
|
||||
|
||||
if ([roles containsObject: MAPIStoreRightFolderOwner])
|
||||
rights |= RightsFolderOwner | RoleNone;
|
||||
|
||||
if ([roles containsObject: MAPIStoreRightFolderContact])
|
||||
rights |= RightsFolderContact;
|
||||
|
||||
// [self logWithFormat: @"rights for roles (%@) = %.8x", roles, rights];
|
||||
|
||||
return rights;
|
||||
|
@ -193,16 +207,16 @@
|
|||
[(SOGoAppointmentFolder *) sogoObject aclSQLListingFilter]];
|
||||
}
|
||||
|
||||
- (int) getPidTagContainerClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagContainerClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [@"IPF.Appointment" asUnicodeInMemCtx: memCtx];
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagDefaultPostMessageClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagDefaultPostMessageClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [@"IPM.Appointment" asUnicodeInMemCtx: memCtx];
|
||||
|
||||
|
|
|
@ -23,13 +23,13 @@
|
|||
#ifndef MAPISTORECALENDARMESSAGE_H
|
||||
#define MAPISTORECALENDARMESSAGE_H
|
||||
|
||||
#import "MAPIStoreGCSMessage.h"
|
||||
#import "MAPIStoreCalTaskMessage.h"
|
||||
|
||||
@class iCalCalendar;
|
||||
@class iCalEvent;
|
||||
@class MAPIStoreAppointmentWrapper;
|
||||
|
||||
@interface MAPIStoreCalendarMessage : MAPIStoreGCSMessage
|
||||
@interface MAPIStoreCalendarMessage : MAPIStoreCalTaskMessage
|
||||
{
|
||||
iCalCalendar *calendar;
|
||||
iCalEvent *masterEvent;
|
||||
|
|
|
@ -228,8 +228,8 @@ static Class NSArrayK, MAPIStoreAppointmentWrapperK;
|
|||
|
||||
|
||||
/* getters */
|
||||
- (int) getPidTagMessageClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagMessageClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
SOGoUser *owner;
|
||||
|
||||
|
@ -242,8 +242,8 @@ static Class NSArrayK, MAPIStoreAppointmentWrapperK;
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidLidSideEffects: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidSideEffects: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx,
|
||||
seOpenToDelete | seOpenToCopy | seOpenToMove
|
||||
|
@ -252,7 +252,7 @@ static Class NSArrayK, MAPIStoreAppointmentWrapperK;
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagProcessed: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagProcessed: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getYes: data inMemCtx: memCtx];
|
||||
}
|
||||
|
@ -347,8 +347,8 @@ static Class NSArrayK, MAPIStoreAppointmentWrapperK;
|
|||
*dataPtr = msgData;
|
||||
}
|
||||
|
||||
- (int) getPidTagResponseRequested: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagResponseRequested: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getYes: data inMemCtx: memCtx];
|
||||
}
|
||||
|
@ -358,8 +358,8 @@ static Class NSArrayK, MAPIStoreAppointmentWrapperK;
|
|||
MAPIStoreMessage base class, then the proxy method is not reached
|
||||
(see MAPIStoreObject).
|
||||
*/
|
||||
- (int) getPidTagNormalizedSubject: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagNormalizedSubject: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
MAPIStoreAppointmentWrapper *appointmentWrapper;
|
||||
|
||||
|
@ -370,8 +370,8 @@ static Class NSArrayK, MAPIStoreAppointmentWrapperK;
|
|||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
- (int) getPidTagSensitivity: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagSensitivity: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
MAPIStoreAppointmentWrapper *appointmentWrapper;
|
||||
|
||||
|
@ -382,8 +382,8 @@ static Class NSArrayK, MAPIStoreAppointmentWrapperK;
|
|||
return [self getLongZero: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagImportance: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagImportance: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
MAPIStoreAppointmentWrapper *appointmentWrapper;
|
||||
|
||||
|
@ -528,29 +528,19 @@ static Class NSArrayK, MAPIStoreAppointmentWrapperK;
|
|||
ASSIGN (sogoObject, newObject);
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanReadMessage
|
||||
- (NSUInteger) sensitivity
|
||||
{
|
||||
NSArray *roles;
|
||||
|
||||
roles = [self activeUserRoles];
|
||||
|
||||
return ([roles containsObject: SOGoCalendarRole_ComponentViewer]
|
||||
|| [roles containsObject: SOGoCalendarRole_ComponentDAndTViewer]
|
||||
|| [self subscriberCanModifyMessage]);
|
||||
return [[self _appointmentWrapper] sensitivity];
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanModifyMessage
|
||||
- (NSString *) creator
|
||||
{
|
||||
BOOL rc;
|
||||
NSArray *roles = [self activeUserRoles];
|
||||
return [[self _appointmentWrapper] creator];
|
||||
}
|
||||
|
||||
if (isNew)
|
||||
rc = [roles containsObject: SOGoRole_ObjectCreator];
|
||||
else
|
||||
rc = ([roles containsObject: SOGoCalendarRole_ComponentModifier]
|
||||
|| [roles containsObject: SOGoCalendarRole_ComponentResponder]);
|
||||
|
||||
return rc;
|
||||
- (NSString *) owner
|
||||
{
|
||||
return [[self _appointmentWrapper] owner];
|
||||
}
|
||||
|
||||
- (void) _updateAttachedEvents
|
||||
|
@ -632,6 +622,7 @@ static Class NSArrayK, MAPIStoreAppointmentWrapperK;
|
|||
[masterEvent updateFromMAPIProperties: properties
|
||||
inUserContext: [self userContext]
|
||||
withActiveUser: activeUser
|
||||
isNew: isNew
|
||||
inMemCtx: memCtx];
|
||||
[self _updateAttachedEvents];
|
||||
[[self userContext] activate];
|
||||
|
|
|
@ -92,52 +92,52 @@
|
|||
return [container lastModificationTime];
|
||||
}
|
||||
|
||||
- (int) getPidTagAttachEncoding: (void **) data inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidTagAttachEncoding: (void **) data inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
{
|
||||
*data = [[NSData data] asBinaryInMemCtx: memCtx];
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagAttachFlags: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagAttachFlags: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getLongZero: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagAttachmentFlags: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagAttachmentFlags: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getLongZero: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagAttachmentHidden: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagAttachmentHidden: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getNo: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagAttachmentLinkId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagAttachmentLinkId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getLongZero: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagAttachMethod: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagAttachMethod: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, 0x00000001);
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagAttachmentContactPhoto: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagAttachmentContactPhoto: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getYes: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagAttachDataBinary: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagAttachDataBinary: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
if (!photoData)
|
||||
ASSIGN (photoData,
|
||||
|
@ -148,8 +148,8 @@
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagAttachSize: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagAttachSize: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
if (!photoData)
|
||||
ASSIGN (photoData,
|
||||
|
@ -160,16 +160,16 @@
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagAttachExtension: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagAttachExtension: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [[self fileExtension] asUnicodeInMemCtx: memCtx];
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagAttachLongFilename: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagAttachLongFilename: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *filename;
|
||||
|
||||
|
@ -181,15 +181,15 @@
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagAttachFilename: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagAttachFilename: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPidTagAttachLongFilename: data
|
||||
inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagDisplayName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagDisplayName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPidTagAttachLongFilename: data inMemCtx: memCtx];
|
||||
}
|
||||
|
|
|
@ -74,18 +74,34 @@
|
|||
|
||||
- (NSArray *) rolesForExchangeRights: (uint32_t) rights
|
||||
{
|
||||
/* Limitations
|
||||
|
||||
Following rights are not supported by SOGo specifically:
|
||||
|
||||
- CreateSubfolders: No contacts subfolders
|
||||
- FolderVisible: It is inferred by other rights when extracting
|
||||
*/
|
||||
NSMutableArray *roles;
|
||||
|
||||
roles = [NSMutableArray arrayWithCapacity: 6];
|
||||
roles = [NSMutableArray arrayWithCapacity: 8];
|
||||
if (rights & RightsCreateItems)
|
||||
[roles addObject: SOGoRole_ObjectCreator];
|
||||
if (rights & RightsDeleteAll)
|
||||
[roles addObject: SOGoRole_ObjectEraser];
|
||||
if (rights & RightsDeleteOwn)
|
||||
[roles addObject: MAPIStoreRightDeleteOwn];
|
||||
if (rights & RightsEditAll)
|
||||
[roles addObject: SOGoRole_ObjectEditor];
|
||||
if (rights & RightsEditOwn)
|
||||
[roles addObject: MAPIStoreRightEditOwn];
|
||||
if (rights & RightsReadItems)
|
||||
[roles addObject: SOGoRole_ObjectViewer];
|
||||
|
||||
if (rights & RightsFolderOwner)
|
||||
[roles addObject: MAPIStoreRightFolderOwner];
|
||||
if (rights & RightsFolderContact)
|
||||
[roles addObject: MAPIStoreRightFolderContact];
|
||||
|
||||
return roles;
|
||||
}
|
||||
|
||||
|
@ -95,15 +111,28 @@
|
|||
|
||||
if ([roles containsObject: SOGoRole_ObjectCreator])
|
||||
rights |= RightsCreateItems;
|
||||
|
||||
if ([roles containsObject: SOGoRole_ObjectEraser])
|
||||
rights |= RightsDeleteAll | RightsDeleteOwn;
|
||||
else if ([roles containsObject: MAPIStoreRightDeleteOwn])
|
||||
rights |= RightsDeleteOwn;
|
||||
|
||||
if ([roles containsObject: SOGoRole_ObjectEditor])
|
||||
rights |= RightsEditAll | RightsEditOwn;
|
||||
else if ([roles containsObject: MAPIStoreRightEditOwn])
|
||||
rights |= RightsEditOwn;
|
||||
|
||||
if ([roles containsObject: SOGoRole_ObjectViewer])
|
||||
rights |= RightsReadItems;
|
||||
if (rights != 0)
|
||||
rights |= RoleNone; /* actually "folder visible" */
|
||||
|
||||
if ([roles containsObject: MAPIStoreRightFolderOwner])
|
||||
rights |= RightsFolderOwner | RoleNone;
|
||||
|
||||
if ([roles containsObject: MAPIStoreRightFolderContact])
|
||||
rights |= RightsFolderContact;
|
||||
|
||||
return rights;
|
||||
}
|
||||
|
||||
|
@ -117,8 +146,8 @@
|
|||
return [[self activeUserRoles] containsObject: SOGoRole_ObjectViewer];
|
||||
}
|
||||
|
||||
- (int) getPidTagDefaultPostMessageClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagDefaultPostMessageClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [@"IPM.Contact" asUnicodeInMemCtx: memCtx];
|
||||
|
||||
|
|
|
@ -31,9 +31,11 @@
|
|||
#import <NGCards/NGVCardPhoto.h>
|
||||
#import <NGCards/NSArray+NGCards.h>
|
||||
#import <NGCards/NSString+NGCards.h>
|
||||
#import <NGObjWeb/WOContext+SoObjects.h>
|
||||
#import <Contacts/SOGoContactGCSEntry.h>
|
||||
#import <Mailer/NSString+Mail.h>
|
||||
#import <SOGo/SOGoPermissions.h>
|
||||
#import <SOGo/SOGoUser.h>
|
||||
#import <SOGo/SOGoUserManager.h>
|
||||
|
||||
#import "MAPIStoreAttachment.h"
|
||||
|
@ -104,8 +106,8 @@
|
|||
return element;
|
||||
}
|
||||
|
||||
- (int) getPidTagIconIndex: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagIconIndex: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
/* see http://msdn.microsoft.com/en-us/library/cc815472.aspx */
|
||||
*data = MAPILongValue (memCtx, 0x00000200);
|
||||
|
@ -113,52 +115,52 @@
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagAlternateRecipientAllowed: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagAlternateRecipientAllowed: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
|
||||
{
|
||||
return [self getYes: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagMessageFlags: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagMessageFlags: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, MSGFLAG_READ);
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagDeleteAfterSubmit: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagDeleteAfterSubmit: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
|
||||
{
|
||||
return [self getNo: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagMessageClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagMessageClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = talloc_strdup (memCtx, "IPM.Contact");
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagSendInternetEncoding: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagSendInternetEncoding: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, 0x00065001);
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagNormalizedSubject: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagNormalizedSubject: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPidTagDisplayName: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidFileUnder: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidFileUnder: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *surName, *givenName, *middleName;
|
||||
NSMutableString *fileUnder;
|
||||
|
@ -184,22 +186,22 @@
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidLidFileUnderId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidFileUnderId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, 0x00008017); /* what ol2003 sets */
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagAccount: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagAccount: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPidLidEmail1EmailAddress: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagContactEmailAddresses: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagContactEmailAddresses: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *stringValue;
|
||||
|
||||
|
@ -212,8 +214,8 @@
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagEmsAbTargetAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagEmsAbTargetAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *stringValue;
|
||||
|
||||
|
@ -224,8 +226,8 @@
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagSearchKey: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagSearchKey: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *stringValue;
|
||||
|
||||
|
@ -236,16 +238,16 @@
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagMailPermission: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagMailPermission: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getYes: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagBody: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagBody: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
int rc = MAPISTORE_SUCCESS;
|
||||
enum mapistore_error rc = MAPISTORE_SUCCESS;
|
||||
NSString *stringValue;
|
||||
|
||||
stringValue = [[sogoObject vCard] note];
|
||||
|
@ -257,8 +259,8 @@
|
|||
return rc;
|
||||
}
|
||||
|
||||
- (int) getPidTagSensitivity: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagSensitivity: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getLongZero: data inMemCtx: memCtx];
|
||||
}
|
||||
|
@ -267,8 +269,8 @@
|
|||
// Contact Name Properties [MS-OXOCNTC 2.2.1.1]
|
||||
// ---------------------------------------------------------
|
||||
|
||||
- (int) getPidTagNickname: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagNickname: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *stringValue;
|
||||
|
||||
|
@ -278,8 +280,8 @@
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagGeneration: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagGeneration: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *stringValue;
|
||||
|
||||
|
@ -291,8 +293,8 @@
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagSurname: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagSurname: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *stringValue;
|
||||
|
||||
|
@ -304,8 +306,8 @@
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagMiddleName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagMiddleName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *stringValue;
|
||||
|
||||
|
@ -317,8 +319,8 @@
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagGivenName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagGivenName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *stringValue;
|
||||
|
||||
|
@ -330,8 +332,8 @@
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagDisplayNamePrefix: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagDisplayNamePrefix: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *stringValue;
|
||||
|
||||
|
@ -398,9 +400,9 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
|
|||
Store on *data the given email (position)
|
||||
It can return MAPISTORE_ERR_NOT_FOUND if the email doesn't exist
|
||||
*/
|
||||
- (int) _getPidLidEmailAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
atPosition: (NSUInteger) position
|
||||
- (enum mapistore_error) _getPidLidEmailAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
atPosition: (NSUInteger) position
|
||||
{
|
||||
NSString *email;
|
||||
|
||||
|
@ -412,60 +414,60 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidLidEmail1EmailAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidEmail1EmailAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getPidLidEmailAddress: data inMemCtx: memCtx atPosition: 1];
|
||||
}
|
||||
|
||||
- (int) getPidLidEmail2EmailAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidEmail2EmailAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getPidLidEmailAddress: data inMemCtx: memCtx atPosition: 2];
|
||||
}
|
||||
|
||||
- (int) getPidLidEmail3EmailAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidEmail3EmailAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getPidLidEmailAddress: data inMemCtx: memCtx atPosition: 3];
|
||||
}
|
||||
|
||||
- (int) getPidLidEmail1OriginalDisplayName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidEmail1OriginalDisplayName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPidLidEmail1EmailAddress: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidEmail2OriginalDisplayName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidEmail2OriginalDisplayName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPidLidEmail2EmailAddress: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidEmail3OriginalDisplayName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidEmail3OriginalDisplayName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPidLidEmail3EmailAddress: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidEmail1AddressType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidEmail1AddressType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
if (![self _fetchEmailAddress: 1]) return MAPISTORE_ERR_NOT_FOUND;
|
||||
|
||||
return [self getSMTPAddrType: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidEmail2AddressType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidEmail2AddressType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
if (![self _fetchEmailAddress: 2]) return MAPISTORE_ERR_NOT_FOUND;
|
||||
|
||||
return [self getSMTPAddrType: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidEmail3AddressType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidEmail3AddressType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
if (![self _fetchEmailAddress: 3]) return MAPISTORE_ERR_NOT_FOUND;
|
||||
|
||||
|
@ -476,9 +478,9 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
|
|||
Store on *data a string with the display name for the given email (position)
|
||||
It can return MAPISTORE_ERR_NOT_FOUND if the email doesn't exist
|
||||
*/
|
||||
- (int) _getPidLidEmailDisplayName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
atPosition: (NSUInteger) position
|
||||
- (enum mapistore_error) _getPidLidEmailDisplayName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
atPosition: (NSUInteger) position
|
||||
{
|
||||
NGVCard *vCard;
|
||||
NSString *fn, *email;
|
||||
|
@ -495,20 +497,20 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidLidEmail1DisplayName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidEmail1DisplayName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getPidLidEmailDisplayName: data inMemCtx: memCtx atPosition: 1];
|
||||
}
|
||||
|
||||
- (int) getPidLidEmail2DisplayName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidEmail2DisplayName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getPidLidEmailDisplayName: data inMemCtx: memCtx atPosition: 2];
|
||||
}
|
||||
|
||||
- (int) getPidLidEmail3DisplayName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidEmail3DisplayName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getPidLidEmailDisplayName: data inMemCtx: memCtx atPosition: 3];
|
||||
}
|
||||
|
@ -544,9 +546,9 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
|
|||
Store on *data an entryId for the given email (position)
|
||||
It can return MAPISTORE_ERR_NOT_FOUND if the email doesn't exist
|
||||
*/
|
||||
- (int) _getPidLidEmailOriginalEntryId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
atPosition: (NSUInteger) position
|
||||
- (enum mapistore_error) _getPidLidEmailOriginalEntryId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
atPosition: (NSUInteger) position
|
||||
{
|
||||
NSData *value;
|
||||
|
||||
|
@ -558,36 +560,36 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidLidEmail1OriginalEntryId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidEmail1OriginalEntryId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getPidLidEmailOriginalEntryId: data
|
||||
inMemCtx: memCtx
|
||||
atPosition: 1];
|
||||
}
|
||||
|
||||
- (int) getPidLidEmail2OriginalEntryId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidEmail2OriginalEntryId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getPidLidEmailOriginalEntryId: data
|
||||
inMemCtx: memCtx
|
||||
atPosition: 2];
|
||||
}
|
||||
|
||||
- (int) getPidLidEmail3OriginalEntryId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidEmail3OriginalEntryId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getPidLidEmailOriginalEntryId: data
|
||||
inMemCtx: memCtx
|
||||
atPosition: 3];
|
||||
}
|
||||
|
||||
- (int) _getElement: (NSString *) elementTag
|
||||
ofType: (NSString *) aType
|
||||
excluding: (NSString *) aTypeToExclude
|
||||
atPos: (NSUInteger) pos
|
||||
inData: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) _getElement: (NSString *) elementTag
|
||||
ofType: (NSString *) aType
|
||||
excluding: (NSString *) aTypeToExclude
|
||||
atPos: (NSUInteger) pos
|
||||
inData: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSArray *elements;
|
||||
CardElement *ce;
|
||||
|
@ -611,15 +613,15 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
|
|||
}
|
||||
|
||||
if (!stringValue)
|
||||
stringValue = @"";
|
||||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
|
||||
*data = [stringValue asUnicodeInMemCtx: memCtx];
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagBusinessFaxNumber: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagBusinessFaxNumber: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"tel" ofType: @"fax" excluding: nil
|
||||
atPos: 0 inData: data inMemCtx: memCtx];
|
||||
|
@ -656,30 +658,39 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
|
|||
return list;
|
||||
}
|
||||
|
||||
- (int) getPidLidAddressBookProviderArrayType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidAddressBookProviderArrayType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
// [MS-OXOCNTC] 2.2.1.2.12
|
||||
// https://msdn.microsoft.com/en-us/library/ee218011%28v=exchg.80%29.aspx
|
||||
uint32_t value = 0;
|
||||
NSArray *emailList = [self _buildAddressBookProviderEmailList];
|
||||
|
||||
for (NSNumber *maskValue in emailList)
|
||||
value |= 1 << [maskValue intValue];
|
||||
if ([emailList count] > 0)
|
||||
{
|
||||
for (NSNumber *maskValue in emailList)
|
||||
value |= 1 << [maskValue intValue];
|
||||
|
||||
*data = MAPILongValue (memCtx, value);
|
||||
*data = MAPILongValue (memCtx, value);
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
else
|
||||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
- (int) getPidLidAddressBookProviderEmailList: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidAddressBookProviderEmailList: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSArray *emailList = [self _buildAddressBookProviderEmailList];
|
||||
|
||||
*data = [emailList asMVLongInMemCtx: memCtx];
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
if ([emailList count] > 0)
|
||||
{
|
||||
*data = [emailList asMVLongInMemCtx: memCtx];
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
else
|
||||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
@ -688,49 +699,49 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
|
|||
|
||||
// Home Address
|
||||
|
||||
- (int) getPidTagHomeAddressStreet: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagHomeAddressStreet: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"adr" ofType: @"home" excluding: nil
|
||||
atPos: 2 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagHomeAddressCity: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagHomeAddressCity: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"adr" ofType: @"home" excluding: nil
|
||||
atPos: 3 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagHomeAddressStateOrProvince: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagHomeAddressStateOrProvince: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"adr" ofType: @"home" excluding: nil
|
||||
atPos: 4 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagHomeAddressPostalCode: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagHomeAddressPostalCode: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"adr" ofType: @"home" excluding: nil
|
||||
atPos: 5 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
- (int) getPidTagHomeAddressCountry: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagHomeAddressCountry: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"adr" ofType: @"home" excluding: nil
|
||||
atPos: 6 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagHomeAddressPostOfficeBox: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagHomeAddressPostOfficeBox: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"adr" ofType: @"home" excluding: nil
|
||||
atPos: 0 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidHomeAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidHomeAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"label" ofType: @"home" excluding: nil
|
||||
atPos: 0 inData: data inMemCtx: memCtx];
|
||||
|
@ -738,50 +749,50 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
|
|||
|
||||
// Work Address
|
||||
|
||||
- (int) getPidLidWorkAddressStreet: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidWorkAddressStreet: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"adr" ofType: @"work" excluding: nil
|
||||
atPos: 2 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidWorkAddressCity: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidWorkAddressCity: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"adr" ofType: @"work" excluding: nil
|
||||
atPos: 3 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidWorkAddressState: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidWorkAddressState: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"adr" ofType: @"work" excluding: nil
|
||||
atPos: 4 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidWorkAddressPostalCode: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidWorkAddressPostalCode: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"adr" ofType: @"work" excluding: nil
|
||||
atPos: 5 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidWorkAddressCountry: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidWorkAddressCountry: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"adr" ofType: @"work" excluding: nil
|
||||
atPos: 6 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidWorkAddressPostOfficeBox: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidWorkAddressPostOfficeBox: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"adr" ofType: @"work" excluding: nil
|
||||
atPos: 0 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidWorkAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidWorkAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"label" ofType: @"work" excluding: nil
|
||||
atPos: 0 inData: data inMemCtx: memCtx];
|
||||
|
@ -789,57 +800,57 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
|
|||
|
||||
// Mailing Address
|
||||
|
||||
- (int) getPidTagStreetAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagStreetAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"adr" ofType: @"pref" excluding: nil
|
||||
atPos: 2 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagLocality: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagLocality: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"adr" ofType: @"pref" excluding: nil
|
||||
atPos: 3 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagStateOrProvince: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagStateOrProvince: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"adr" ofType: @"pref" excluding: nil
|
||||
atPos: 4 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagPostalCode: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagPostalCode: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"adr" ofType: @"pref" excluding: nil
|
||||
atPos: 5 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagCountry: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagCountry: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"adr" ofType: @"pref" excluding: nil
|
||||
atPos: 6 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagPostOfficeBox: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagPostOfficeBox: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"adr" ofType: @"pref" excluding: nil
|
||||
atPos: 0 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagPostalAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagPostalAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"label" ofType: @"pref" excluding: nil
|
||||
atPos: 0 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidPostalAddressId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidPostalAddressId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSArray *elements;
|
||||
CardElement *element;
|
||||
|
@ -869,36 +880,36 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
|
|||
// Telephone Properties [MS-OXOCNTC 2.2.1.4]
|
||||
// -------------------------------------------------------
|
||||
|
||||
- (int) getPidTagPagerTelephoneNumber: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagPagerTelephoneNumber: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"tel" ofType: @"pager" excluding: nil
|
||||
atPos: 0 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagBusinessTelephoneNumber: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagBusinessTelephoneNumber: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"tel" ofType: @"work" excluding: @"fax"
|
||||
atPos: 0 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagHomeTelephoneNumber: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagHomeTelephoneNumber: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"tel" ofType: @"home" excluding: @"fax"
|
||||
atPos: 0 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagPrimaryTelephoneNumber: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagPrimaryTelephoneNumber: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"tel" ofType: @"pref" excluding: nil
|
||||
atPos: 0 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagMobileTelephoneNumber: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagMobileTelephoneNumber: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"tel" ofType: @"cell" excluding: nil
|
||||
atPos: 0 inData: data inMemCtx: memCtx];
|
||||
|
@ -908,12 +919,12 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
|
|||
// Event Properties [MS-OXOCNTC 2.2.1.5]
|
||||
// ---------------------------------------------------------
|
||||
|
||||
- (int) getPidTagBirthday: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagBirthday: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSCalendarDate *dateValue;
|
||||
NSString *stringValue;
|
||||
int rc = MAPISTORE_SUCCESS;
|
||||
enum mapistore_error rc = MAPISTORE_SUCCESS;
|
||||
|
||||
stringValue = [[sogoObject vCard] bday];
|
||||
if ([stringValue length] != 0)
|
||||
|
@ -929,12 +940,12 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
|
|||
return rc;
|
||||
}
|
||||
|
||||
- (int) getPidTagWeddingAnniversary: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagWeddingAnniversary: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSCalendarDate *dateValue;
|
||||
NSString *stringValue;
|
||||
int rc = MAPISTORE_SUCCESS;
|
||||
enum mapistore_error rc = MAPISTORE_SUCCESS;
|
||||
|
||||
stringValue = [[[sogoObject vCard] uniqueChildWithTag: @"x-ms-anniversary"]
|
||||
flattenedValuesForKey: @""];
|
||||
|
@ -954,8 +965,8 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
|
|||
// Professional Properties [MS-OXOCNTC 2.2.1.6]
|
||||
// ---------------------------------------------------------
|
||||
|
||||
- (int) getPidTagTitle: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagTitle: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *stringValue;
|
||||
|
||||
|
@ -965,8 +976,8 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagCompanyName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagCompanyName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
CardElement *org;
|
||||
|
||||
|
@ -977,8 +988,8 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagDepartmentName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagDepartmentName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
CardElement *org;
|
||||
|
||||
|
@ -989,11 +1000,11 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagOfficeLocation: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagOfficeLocation: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *stringValue;
|
||||
int rc = MAPISTORE_SUCCESS;
|
||||
enum mapistore_error rc = MAPISTORE_SUCCESS;
|
||||
|
||||
stringValue = [[[sogoObject vCard] uniqueChildWithTag: @"x-ms-office"]
|
||||
flattenedValuesForKey: @""];
|
||||
|
@ -1005,11 +1016,11 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
|
|||
return rc;
|
||||
}
|
||||
|
||||
- (int) getPidTagManagerName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagManagerName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *stringValue;
|
||||
int rc = MAPISTORE_SUCCESS;
|
||||
enum mapistore_error rc = MAPISTORE_SUCCESS;
|
||||
|
||||
stringValue = [[[sogoObject vCard] uniqueChildWithTag: @"x-ms-manager"]
|
||||
flattenedValuesForKey: @""];
|
||||
|
@ -1021,11 +1032,11 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
|
|||
return rc;
|
||||
}
|
||||
|
||||
- (int) getPidTagAssistant: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagAssistant: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *stringValue;
|
||||
int rc = MAPISTORE_SUCCESS;
|
||||
enum mapistore_error rc = MAPISTORE_SUCCESS;
|
||||
|
||||
stringValue = [[[sogoObject vCard] uniqueChildWithTag: @"x-ms-assistant"]
|
||||
flattenedValuesForKey: @""];
|
||||
|
@ -1037,11 +1048,11 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
|
|||
return rc;
|
||||
}
|
||||
|
||||
- (int) getPidTagProfession: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagProfession: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *stringValue;
|
||||
int rc = MAPISTORE_SUCCESS;
|
||||
enum mapistore_error rc = MAPISTORE_SUCCESS;
|
||||
|
||||
stringValue = [[sogoObject vCard] role];
|
||||
if (stringValue)
|
||||
|
@ -1080,8 +1091,8 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
|
|||
fetchedAttachments = YES;
|
||||
}
|
||||
|
||||
- (int) getPidLidHasPicture: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidHasPicture: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
if (!fetchedAttachments)
|
||||
[self _fetchAttachmentParts];
|
||||
|
@ -1154,11 +1165,11 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
|
|||
// Other Properties [MS-OXOCNTC 2.2.1.10]
|
||||
// ---------------------------------------------------------
|
||||
|
||||
- (int) getPidTagSpouseName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagSpouseName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *stringValue;
|
||||
int rc = MAPISTORE_SUCCESS;
|
||||
enum mapistore_error rc = MAPISTORE_SUCCESS;
|
||||
|
||||
stringValue = [[[sogoObject vCard] uniqueChildWithTag: @"x-ms-spouse"]
|
||||
flattenedValuesForKey: @""];
|
||||
|
@ -1170,8 +1181,8 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
|
|||
return rc;
|
||||
}
|
||||
|
||||
- (int) getPidLidInstantMessagingAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidInstantMessagingAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *stringValue;
|
||||
|
||||
|
@ -1184,11 +1195,11 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidLidFreeBusyLocation: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidFreeBusyLocation: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *stringValue;
|
||||
int rc = MAPISTORE_SUCCESS;
|
||||
enum mapistore_error rc = MAPISTORE_SUCCESS;
|
||||
|
||||
stringValue = [[[sogoObject vCard] uniqueChildWithTag: @"fburl"]
|
||||
flattenedValuesForKey: @""];
|
||||
|
@ -1200,38 +1211,43 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
|
|||
return rc;
|
||||
}
|
||||
|
||||
- (int) getPidTagPersonalHomePage: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagPersonalHomePage: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"url" ofType: @"home" excluding: nil
|
||||
atPos: 0 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagBusinessHomePage: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagBusinessHomePage: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getElement: @"url" ofType: @"work" excluding: nil
|
||||
atPos: 0 inData: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// Permissions
|
||||
// ---------------------------------------------------------
|
||||
|
||||
- (NSString *) creator
|
||||
{
|
||||
return [[[sogoObject vCard] uniqueChildWithTag: @"x-openchange-creator"]
|
||||
flattenedValuesForKey: @""];
|
||||
}
|
||||
|
||||
- (NSString *) owner
|
||||
{
|
||||
return [self creator];
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanReadMessage
|
||||
{
|
||||
return [[self activeUserRoles] containsObject: SOGoRole_ObjectViewer];
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanModifyMessage
|
||||
{
|
||||
NSArray *roles;
|
||||
|
||||
roles = [self activeUserRoles];
|
||||
|
||||
return ((isNew
|
||||
&& [roles containsObject: SOGoRole_ObjectCreator])
|
||||
|| (!isNew && [roles containsObject: SOGoRole_ObjectEditor]));
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// Save
|
||||
// ---------------------------------------------------------
|
||||
- (void) saveDistList:(TALLOC_CTX *) memCtx
|
||||
{
|
||||
[self warnWithFormat: @"IPM.DistList messages are ignored"];
|
||||
|
@ -1575,6 +1591,14 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
|
|||
if (value)
|
||||
[newCard setNote: value];
|
||||
|
||||
/* Store the creator name for sharing purposes */
|
||||
if (isNew)
|
||||
{
|
||||
value = [[[self context] activeUser] login];
|
||||
[[newCard uniqueChildWithTag: @"x-openchange-creator"]
|
||||
setSingleValue: value forKey: @""];
|
||||
}
|
||||
|
||||
//
|
||||
// we save the new/modified card
|
||||
//
|
||||
|
|
|
@ -72,10 +72,10 @@
|
|||
forUser: (NSString *) username
|
||||
withRole: (enum mapistore_context_role) role;
|
||||
|
||||
+ (int) openContext: (MAPIStoreContext **) contextPtr
|
||||
withURI: (const char *) newUri
|
||||
connectionInfo: (struct mapistore_connection_info *) newConnInfo
|
||||
andTDBIndexing: (struct indexing_context *) indexing;
|
||||
+ (enum mapistore_error) openContext: (MAPIStoreContext **) contextPtr
|
||||
withURI: (const char *) newUri
|
||||
connectionInfo: (struct mapistore_connection_info *) newConnInfo
|
||||
andTDBIndexing: (struct indexing_context *) indexing;
|
||||
|
||||
- (id) initFromURL: (NSURL *) newUri
|
||||
withConnectionInfo: (struct mapistore_connection_info *) newConnInfo
|
||||
|
@ -91,11 +91,11 @@
|
|||
// - (id) lookupObject: (NSString *) objectURLString;
|
||||
|
||||
/* backend methods */
|
||||
- (int) getPath: (char **) path
|
||||
ofFMID: (uint64_t) fmid
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getRootFolder: (MAPIStoreFolder **) folderPtr
|
||||
withFID: (uint64_t) fmid;
|
||||
- (enum mapistore_error) getPath: (char **) path
|
||||
ofFMID: (uint64_t) fmid
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getRootFolder: (MAPIStoreFolder **) folderPtr
|
||||
withFID: (uint64_t) fmid;
|
||||
|
||||
/* util methods */
|
||||
- (NSString *) extractChildNameFromURL: (NSString *) childURL
|
||||
|
|
|
@ -212,16 +212,16 @@ static inline NSURL *CompleteURLFromMapistoreURI (const char *uri)
|
|||
return completeURL;
|
||||
}
|
||||
|
||||
+ (int) openContext: (MAPIStoreContext **) contextPtr
|
||||
withURI: (const char *) newUri
|
||||
connectionInfo: (struct mapistore_connection_info *) newConnInfo
|
||||
andTDBIndexing: (struct indexing_context *) indexing
|
||||
+ (enum mapistore_error) openContext: (MAPIStoreContext **) contextPtr
|
||||
withURI: (const char *) newUri
|
||||
connectionInfo: (struct mapistore_connection_info *) newConnInfo
|
||||
andTDBIndexing: (struct indexing_context *) indexing
|
||||
{
|
||||
MAPIStoreContext *context;
|
||||
Class contextClass;
|
||||
NSString *module;
|
||||
NSURL *baseURL;
|
||||
int rc = MAPISTORE_ERR_NOT_FOUND;
|
||||
enum mapistore_error rc = MAPISTORE_ERR_NOT_FOUND;
|
||||
|
||||
context = nil;
|
||||
|
||||
|
@ -338,11 +338,11 @@ static inline NSURL *CompleteURLFromMapistoreURI (const char *uri)
|
|||
return activeUser;
|
||||
}
|
||||
|
||||
- (int) getPath: (char **) path
|
||||
ofFMID: (uint64_t) fmid
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPath: (char **) path
|
||||
ofFMID: (uint64_t) fmid
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
NSString *objectURL, *url;
|
||||
|
||||
url = [contextUrl absoluteString];
|
||||
|
@ -379,8 +379,8 @@ static inline NSURL *CompleteURLFromMapistoreURI (const char *uri)
|
|||
{
|
||||
}
|
||||
|
||||
- (int) getRootFolder: (MAPIStoreFolder **) folderPtr
|
||||
withFID: (uint64_t) newFid
|
||||
- (enum mapistore_error) getRootFolder: (MAPIStoreFolder **) folderPtr
|
||||
withFID: (uint64_t) newFid
|
||||
{
|
||||
enum mapistore_error rc;
|
||||
MAPIStoreFolder *baseFolder;
|
||||
|
@ -438,8 +438,16 @@ static inline NSURL *CompleteURLFromMapistoreURI (const char *uri)
|
|||
mapiStoreObjectWithSOGoObject: currentFolder
|
||||
inContainer: nil];
|
||||
[baseFolder setContext: self];
|
||||
*folderPtr = baseFolder;
|
||||
rc = MAPISTORE_SUCCESS;
|
||||
|
||||
if ([[userContext sogoUser] isEqual: activeUser]
|
||||
|| [baseFolder subscriberCanReadMessages])
|
||||
{
|
||||
*folderPtr = baseFolder;
|
||||
rc = MAPISTORE_SUCCESS;
|
||||
}
|
||||
else
|
||||
rc = MAPISTORE_ERR_DENIED;
|
||||
|
||||
}
|
||||
else if ([[userContext sogoUser] isEqual: activeUser])
|
||||
rc = MAPISTORE_ERR_NOT_FOUND;
|
||||
|
@ -494,8 +502,11 @@ static inline NSURL *CompleteURLFromMapistoreURI (const char *uri)
|
|||
mappingId = [mapping idFromURL: childURL];
|
||||
if (mappingId == NSNotFound)
|
||||
{
|
||||
const char *owner;
|
||||
|
||||
[self logWithFormat: @"No id exist yet for '%@', requesting one", childURL];
|
||||
ret = mapistore_indexing_get_new_folderID (connInfo->mstore_ctx, &mappingId);
|
||||
owner = [[userContext username] UTF8String];
|
||||
ret = mapistore_indexing_get_new_folderID_as_user (connInfo->mstore_ctx, owner, &mappingId);
|
||||
if (ret == MAPISTORE_SUCCESS)
|
||||
[mapping registerURL: childURL withID: mappingId];
|
||||
else
|
||||
|
@ -506,36 +517,56 @@ static inline NSURL *CompleteURLFromMapistoreURI (const char *uri)
|
|||
return mappingId;
|
||||
}
|
||||
|
||||
/* Get new change number from openchange db interface using
|
||||
resource's owner user */
|
||||
- (uint64_t) getNewChangeNumber
|
||||
{
|
||||
const char *owner;
|
||||
enum MAPISTATUS retval;
|
||||
uint64_t newVersionNumber;
|
||||
|
||||
if (openchangedb_get_new_changeNumber (connInfo->oc_ctx, connInfo->username, &newVersionNumber)
|
||||
!= MAPI_E_SUCCESS)
|
||||
abort ();
|
||||
owner = [[userContext username] UTF8String];
|
||||
retval = openchangedb_get_new_changeNumber (connInfo->oc_ctx, owner, &newVersionNumber);
|
||||
if (retval != MAPI_E_SUCCESS)
|
||||
[NSException raise: @"MAPIStoreIOException"
|
||||
format: @"Impossible to get new change number for %s: %s", owner,
|
||||
mapi_get_errstr (retval)];
|
||||
|
||||
return newVersionNumber;
|
||||
}
|
||||
|
||||
/* Get new change numbers from openchange db interface using
|
||||
resource's owner user */
|
||||
- (NSArray *) getNewChangeNumbers: (uint64_t) max
|
||||
{
|
||||
const char *owner;
|
||||
enum MAPISTATUS retval;
|
||||
TALLOC_CTX *memCtx;
|
||||
NSMutableArray *newChangeNumbers;
|
||||
uint64_t count;
|
||||
struct UI8Array_r *numbers;
|
||||
NSString *newNumber;
|
||||
|
||||
memCtx = talloc_zero(NULL, TALLOC_CTX);
|
||||
newChangeNumbers = [NSMutableArray arrayWithCapacity: max];
|
||||
memCtx = talloc_new (NULL);
|
||||
if (!memCtx)
|
||||
[NSException raise: @"MAPIStoreIOException"
|
||||
format: @"Not enough memory to allocate change numbers"];
|
||||
|
||||
newChangeNumbers = [NSMutableArray arrayWithCapacity: max];
|
||||
owner = [[userContext username] UTF8String];
|
||||
|
||||
retval = openchangedb_get_new_changeNumbers (connInfo->oc_ctx, memCtx, owner, max, &numbers);
|
||||
if (retval != MAPI_E_SUCCESS || numbers->cValues != max)
|
||||
{
|
||||
talloc_free (memCtx);
|
||||
[NSException raise: @"MAPIStoreIOException"
|
||||
format: @"Failing to get %d new change numbers: %s", max,
|
||||
mapi_get_errstr (retval)];
|
||||
}
|
||||
|
||||
if (openchangedb_get_new_changeNumbers (connInfo->oc_ctx,
|
||||
memCtx, connInfo->username, max, &numbers)
|
||||
!= MAPI_E_SUCCESS || numbers->cValues != max)
|
||||
abort ();
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
newNumber
|
||||
= [NSString stringWithUnsignedLongLong: numbers->lpui8[count]];
|
||||
newNumber = [NSString stringWithUnsignedLongLong: numbers->lpui8[count]];
|
||||
[newChangeNumbers addObject: newNumber];
|
||||
}
|
||||
|
||||
|
@ -544,29 +575,31 @@ static inline NSURL *CompleteURLFromMapistoreURI (const char *uri)
|
|||
return newChangeNumbers;
|
||||
}
|
||||
|
||||
/* Get new fmids from mapistore_indexing interface using resource's
|
||||
owner user */
|
||||
- (NSArray *) getNewFMIDs: (uint64_t) max
|
||||
{
|
||||
TALLOC_CTX *memCtx;
|
||||
const char *owner;
|
||||
enum mapistore_error ret;
|
||||
NSMutableArray *newFMIDs;
|
||||
uint64_t count;
|
||||
struct UI8Array_r *numbers;
|
||||
NSString *newNumber;
|
||||
uint64_t count, newFID;
|
||||
|
||||
memCtx = talloc_zero(NULL, TALLOC_CTX);
|
||||
newFMIDs = [NSMutableArray arrayWithCapacity: max];
|
||||
/* Get the resource's owner name */
|
||||
owner = [[userContext username] UTF8String];
|
||||
|
||||
if (mapistore_indexing_get_new_folderIDs (connInfo->mstore_ctx,
|
||||
memCtx, max, &numbers)
|
||||
!= MAPISTORE_SUCCESS || numbers->cValues != max)
|
||||
abort ();
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
newNumber = [NSString stringWithUnsignedLongLong: numbers->lpui8[count]];
|
||||
ret = mapistore_indexing_get_new_folderID_as_user (connInfo->mstore_ctx, owner, &newFID);
|
||||
if (ret != MAPISTORE_SUCCESS)
|
||||
[NSException raise: @"MAPIStoreIOException"
|
||||
format: @"Impossible to get new fmid for %s", owner];
|
||||
|
||||
newNumber = [NSString stringWithUnsignedLongLong: newFID];
|
||||
[newFMIDs addObject: newNumber];
|
||||
}
|
||||
|
||||
talloc_free (memCtx);
|
||||
|
||||
return newFMIDs;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,16 @@
|
|||
|
||||
#import "MAPIStoreFolder.h"
|
||||
|
||||
extern NSString *MAPIStoreRightReadItems;
|
||||
extern NSString *MAPIStoreRightCreateItems;
|
||||
extern NSString *MAPIStoreRightEditOwn;
|
||||
extern NSString *MAPIStoreRightEditAll;
|
||||
extern NSString *MAPIStoreRightDeleteOwn;
|
||||
extern NSString *MAPIStoreRightDeleteAll;
|
||||
extern NSString *MAPIStoreRightCreateSubfolders;
|
||||
extern NSString *MAPIStoreRightFolderOwner;
|
||||
extern NSString *MAPIStoreRightFolderContact;
|
||||
|
||||
@interface MAPIStoreDBFolder : MAPIStoreFolder
|
||||
|
||||
@end
|
||||
|
|
|
@ -51,16 +51,6 @@
|
|||
|
||||
static Class EOKeyValueQualifierK, SOGoCacheGCSFolderK, MAPIStoreDBFolderK;
|
||||
|
||||
static NSString *MAPIStoreRightReadItems = @"RightsReadItems";
|
||||
static NSString *MAPIStoreRightCreateItems = @"RightsCreateItems";
|
||||
static NSString *MAPIStoreRightEditOwn = @"RightsEditOwn";
|
||||
static NSString *MAPIStoreRightEditAll = @"RightsEditAll";
|
||||
static NSString *MAPIStoreRightDeleteOwn = @"RightsDeleteOwn";
|
||||
static NSString *MAPIStoreRightDeleteAll = @"RightsDeleteAll";
|
||||
static NSString *MAPIStoreRightCreateSubfolders = @"RightsCreateSubfolders";
|
||||
static NSString *MAPIStoreRightFolderOwner = @"RightsFolderOwner";
|
||||
static NSString *MAPIStoreRightFolderContact = @"RightsFolderContact";
|
||||
|
||||
@implementation MAPIStoreDBFolder
|
||||
|
||||
+ (void) initialize
|
||||
|
@ -355,8 +345,7 @@ static NSString *MAPIStoreRightFolderContact = @"RightsFolderContact";
|
|||
|
||||
- (BOOL) subscriberCanModifyMessages
|
||||
{
|
||||
return ([self _testRoleForActiveUser: MAPIStoreRightEditAll]
|
||||
|| [self _testRoleForActiveUser: MAPIStoreRightEditOwn]);
|
||||
return [self _testRoleForActiveUser: MAPIStoreRightEditAll];
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanReadMessages
|
||||
|
@ -377,8 +366,7 @@ static NSString *MAPIStoreRightFolderContact = @"RightsFolderContact";
|
|||
|
||||
- (BOOL) subscriberCanDeleteMessages
|
||||
{
|
||||
return ([self _testRoleForActiveUser: MAPIStoreRightDeleteAll]
|
||||
|| [self _testRoleForActiveUser: MAPIStoreRightDeleteOwn]);
|
||||
return [self _testRoleForActiveUser: MAPIStoreRightDeleteAll];
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanCreateSubFolders
|
||||
|
|
|
@ -27,6 +27,9 @@
|
|||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSValue.h>
|
||||
#import <NGExtensions/NSObject+Logs.h>
|
||||
#import <NGObjWeb/WOContext+SoObjects.h>
|
||||
#import <SOGo/SOGoFolder.h>
|
||||
#import <SOGo/SOGoUser.h>
|
||||
|
||||
#import "MAPIStoreContext.h"
|
||||
#import "MAPIStorePropertySelectors.h"
|
||||
|
@ -282,7 +285,7 @@
|
|||
// We might get there if for some reasons, all classes weren't able
|
||||
// to tell us the message class.
|
||||
//
|
||||
- (int) getPidTagMessageClass: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagMessageClass: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [@"IPM.Note" asUnicodeInMemCtx: memCtx];
|
||||
|
||||
|
@ -291,10 +294,10 @@
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getProperties: (struct mapistore_property_data *) data
|
||||
withTags: (enum MAPITAGS *) tags
|
||||
andCount: (uint16_t) columnCount
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getProperties: (struct mapistore_property_data *) data
|
||||
withTags: (enum MAPITAGS *) tags
|
||||
andCount: (uint16_t) columnCount
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
[sogoObject reloadIfNeeded];
|
||||
|
||||
|
@ -304,12 +307,12 @@
|
|||
inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getProperty: (void **) data
|
||||
withTag: (enum MAPITAGS) propTag
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getProperty: (void **) data
|
||||
withTag: (enum MAPITAGS) propTag
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
id value;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
value = [properties objectForKey: MAPIPropertyKey (propTag)];
|
||||
if (value)
|
||||
|
@ -346,6 +349,16 @@
|
|||
/* Update PredecessorChangeList accordingly */
|
||||
[self _updatePredecessorChangeList];
|
||||
|
||||
if (isNew)
|
||||
{
|
||||
NSString *lastModifierName;
|
||||
|
||||
lastModifierName = (NSString *)[properties objectForKey: MAPIPropertyKey (PidTagLastModifierName)];
|
||||
if ([lastModifierName length] > 0)
|
||||
[properties setObject: lastModifierName
|
||||
forKey: MAPIPropertyKey (PidTagCreatorName)];
|
||||
}
|
||||
|
||||
// [self logWithFormat: @"Saving %@", [self description]];
|
||||
// [self logWithFormat: @"%d props in dict", [properties count]];
|
||||
|
||||
|
@ -364,20 +377,77 @@
|
|||
return [msgClass isEqualToString: @"IPM.Microsoft.ScheduleData.FreeBusy"];
|
||||
}
|
||||
|
||||
/* TODO: differentiate between the "Own" and "All" cases */
|
||||
//-----------------------------
|
||||
// Permissions
|
||||
//-----------------------------
|
||||
|
||||
- (BOOL) subscriberCanReadMessage
|
||||
{
|
||||
return [(MAPIStoreFolder *) container subscriberCanReadMessages];
|
||||
// || [self _messageIsFreeBusy]);
|
||||
}
|
||||
|
||||
- (SOGoUser *) _ownerUser
|
||||
{
|
||||
NSString *ownerName;
|
||||
SOGoUser *ownerUser = nil;
|
||||
|
||||
ownerName = [properties objectForKey: MAPIPropertyKey (PidTagCreatorName)];
|
||||
if ([ownerName length] > 0)
|
||||
ownerUser = [SOGoUser userWithLogin: ownerName];
|
||||
|
||||
return ownerUser;
|
||||
}
|
||||
|
||||
- (NSArray *) activeUserRoles
|
||||
{
|
||||
/* Override because of this exception: NSInvalidArgumentException,
|
||||
reason: [SOGoMAPIDBMessage-aclsForUser:] should be overridden by
|
||||
subclass */
|
||||
if (!activeUserRoles)
|
||||
{
|
||||
SOGoUser *activeUser;
|
||||
|
||||
activeUser = [[self context] activeUser];
|
||||
activeUserRoles = [[container aclFolder] aclsForUser: [activeUser login]];
|
||||
[activeUserRoles retain];
|
||||
}
|
||||
|
||||
return activeUserRoles;
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanModifyMessage
|
||||
{
|
||||
return ((isNew
|
||||
&& [(MAPIStoreFolder *) container subscriberCanCreateMessages])
|
||||
|| (!isNew
|
||||
&& [(MAPIStoreFolder *) container subscriberCanModifyMessages]));
|
||||
// || [self _messageIsFreeBusy]);
|
||||
BOOL rc;
|
||||
NSArray *roles;
|
||||
|
||||
roles = [self activeUserRoles];
|
||||
|
||||
if (isNew)
|
||||
rc = [(MAPIStoreFolder *) container subscriberCanCreateMessages];
|
||||
else
|
||||
rc = [roles containsObject: MAPIStoreRightEditAll];
|
||||
|
||||
/* Check if the message is owned and it has permission to edit it */
|
||||
if (!rc && [roles containsObject: MAPIStoreRightEditOwn])
|
||||
rc = [[[container context] activeUser] isEqual: [self _ownerUser]];
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanDeleteMessage
|
||||
{
|
||||
BOOL rc;
|
||||
NSArray *roles;
|
||||
|
||||
roles = [self activeUserRoles];
|
||||
|
||||
rc = [roles containsObject: MAPIStoreRightDeleteAll];
|
||||
|
||||
/* Check if the message is owned and it has permission to delete it */
|
||||
if (!rc && [roles containsObject: MAPIStoreRightDeleteOwn])
|
||||
rc = [[[container context] activeUser] isEqual: [self _ownerUser]];
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
- (NSDate *) creationTime
|
||||
|
|
|
@ -56,81 +56,81 @@ static Class MAPIStoreAttachmentK;
|
|||
idForObjectWithKey: objectKey];
|
||||
}
|
||||
|
||||
- (int) getPidTagAccessLevel: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagAccessLevel: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getLongZero: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
/* disabled properties */
|
||||
- (int) getPidTagFolderId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagFolderId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
- (int) getPidTagChangeKey: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagChangeKey: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
- (int) getPidTagSourceKey: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagSourceKey: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
- (int) getPidTagParentSourceKey: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagParentSourceKey: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
- (int) getPidTagChangeNumber: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagChangeNumber: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
- (int) getPidTagInstID: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagInstID: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
- (int) getPidTagInstanceNum: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagInstanceNum: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
- (int) getPidTagRowType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagRowType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
- (int) getPidTagDepth: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagDepth: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
- (int) getPidTagIconIndex: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagIconIndex: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
- (int) getPidTagGenerateExchangeViews: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagGenerateExchangeViews: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
- (int) getPidTagOriginalMessageClass: (void **) dataa
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagOriginalMessageClass: (void **) dataa
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
#import "MAPIStoreActiveTables.h"
|
||||
#import "MAPIStoreContext.h"
|
||||
#import "MAPIStoreFolder.h"
|
||||
#import "MAPIStoreUserContext.h"
|
||||
#import "NSObject+MAPIStore.h"
|
||||
|
||||
|
@ -45,8 +46,8 @@
|
|||
andType: MAPISTORE_FAI_TABLE];
|
||||
}
|
||||
|
||||
- (int) getPidTagAssociated: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagAssociated: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getYes: data inMemCtx: memCtx];
|
||||
}
|
||||
|
@ -69,7 +70,7 @@
|
|||
|
||||
- (BOOL) subscriberCanReadMessage
|
||||
{
|
||||
return NO;
|
||||
return [(MAPIStoreFolder *)container subscriberCanReadMessages];
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanModifyMessage
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#define MAPISTOREFOLDER_H
|
||||
|
||||
#import <Foundation/NSObject.h>
|
||||
#import <Foundation/NSString.h>
|
||||
|
||||
@class NSArray;
|
||||
@class NSMutableArray;
|
||||
|
@ -41,6 +42,20 @@
|
|||
|
||||
#import "MAPIStoreSOGoObject.h"
|
||||
|
||||
/* MAPI Permissions
|
||||
|
||||
This set has only sogo-openchange library scope
|
||||
*/
|
||||
extern NSString *MAPIStoreRightReadItems;
|
||||
extern NSString *MAPIStoreRightCreateItems;
|
||||
extern NSString *MAPIStoreRightEditOwn;
|
||||
extern NSString *MAPIStoreRightEditAll;
|
||||
extern NSString *MAPIStoreRightDeleteOwn;
|
||||
extern NSString *MAPIStoreRightDeleteAll;
|
||||
extern NSString *MAPIStoreRightCreateSubfolders;
|
||||
extern NSString *MAPIStoreRightFolderOwner;
|
||||
extern NSString *MAPIStoreRightFolderContact;
|
||||
|
||||
@interface MAPIStoreFolder : MAPIStoreSOGoObject
|
||||
{
|
||||
MAPIStoreContext *context;
|
||||
|
@ -74,6 +89,8 @@
|
|||
- (MAPIStorePermissionsTable *) permissionsTable;
|
||||
- (NSArray *) permissionEntries;
|
||||
|
||||
- (NSArray *) expandRoles: (NSArray *) roles;
|
||||
|
||||
/* message objects and tables */
|
||||
- (id) lookupMessage: (NSString *) messageKey;
|
||||
- (NSArray *) messageKeys;
|
||||
|
@ -96,34 +113,34 @@
|
|||
|
||||
/* backend interface */
|
||||
|
||||
- (int) openFolder: (MAPIStoreFolder **) childFolderPtr
|
||||
withFID: (uint64_t) fid;
|
||||
- (int) createFolder: (MAPIStoreFolder **) childFolderPtr
|
||||
withRow: (struct SRow *) aRow
|
||||
andFID: (uint64_t) fid;
|
||||
- (int) deleteFolder;
|
||||
- (int) getChildCount: (uint32_t *) rowCount
|
||||
ofTableType: (enum mapistore_table_type) tableType;
|
||||
- (enum mapistore_error) openFolder: (MAPIStoreFolder **) childFolderPtr
|
||||
withFID: (uint64_t) fid;
|
||||
- (enum mapistore_error) createFolder: (MAPIStoreFolder **) childFolderPtr
|
||||
withRow: (struct SRow *) aRow
|
||||
andFID: (uint64_t) fid;
|
||||
- (enum mapistore_error) deleteFolder;
|
||||
- (enum mapistore_error) getChildCount: (uint32_t *) rowCount
|
||||
ofTableType: (enum mapistore_table_type) tableType;
|
||||
|
||||
- (int) createMessage: (MAPIStoreMessage **) messagePtr
|
||||
withMID: (uint64_t) mid
|
||||
isAssociated: (BOOL) isAssociated;
|
||||
- (enum mapistore_error) createMessage: (MAPIStoreMessage **) messagePtr
|
||||
withMID: (uint64_t) mid
|
||||
isAssociated: (BOOL) isAssociated;
|
||||
|
||||
- (int) openMessage: (MAPIStoreMessage **) messagePtr
|
||||
withMID: (uint64_t) mid
|
||||
forWriting: (BOOL) readWrite
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) deleteMessageWithMID: (uint64_t) mid
|
||||
andFlags: (uint8_t) flags;
|
||||
- (enum mapistore_error) openMessage: (MAPIStoreMessage **) messagePtr
|
||||
withMID: (uint64_t) mid
|
||||
forWriting: (BOOL) readWrite
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) deleteMessageWithMID: (uint64_t) mid
|
||||
andFlags: (uint8_t) flags;
|
||||
|
||||
- (int) moveCopyMessagesWithMIDs: (uint64_t *) srcMids
|
||||
andCount: (uint32_t) count
|
||||
fromFolder: (MAPIStoreFolder *) sourceFolder
|
||||
withMIDs: (uint64_t *) targetMids
|
||||
andChangeKeys: (struct Binary_r **) targetChangeKeys
|
||||
andPredecessorChangeLists: (struct Binary_r **) targetPredecessorChangeLists
|
||||
wantCopy: (uint8_t) want_copy
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) moveCopyMessagesWithMIDs: (uint64_t *) srcMids
|
||||
andCount: (uint32_t) count
|
||||
fromFolder: (MAPIStoreFolder *) sourceFolder
|
||||
withMIDs: (uint64_t *) targetMids
|
||||
andChangeKeys: (struct Binary_r **) targetChangeKeys
|
||||
andPredecessorChangeLists: (struct Binary_r **) targetPredecessorChangeLists
|
||||
wantCopy: (uint8_t) want_copy
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
|
||||
- (enum mapistore_error) moveCopyToFolder: (MAPIStoreFolder *) targetFolder
|
||||
withNewName: (NSString *) newFolderName
|
||||
|
@ -131,20 +148,20 @@
|
|||
isRecursive: (BOOL) isRecursive
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
|
||||
- (int) getDeletedFMIDs: (struct UI8Array_r **) fmidsPtr
|
||||
andCN: (uint64_t *) cnPtr
|
||||
fromChangeNumber: (uint64_t) changeNum
|
||||
inTableType: (enum mapistore_table_type) tableType
|
||||
inMemCtx: (TALLOC_CTX *) mem_ctx;
|
||||
- (enum mapistore_error) getDeletedFMIDs: (struct UI8Array_r **) fmidsPtr
|
||||
andCN: (uint64_t *) cnPtr
|
||||
fromChangeNumber: (uint64_t) changeNum
|
||||
inTableType: (enum mapistore_table_type) tableType
|
||||
inMemCtx: (TALLOC_CTX *) mem_ctx;
|
||||
|
||||
- (int) getTable: (MAPIStoreTable **) tablePtr
|
||||
andRowCount: (uint32_t *) count
|
||||
tableType: (enum mapistore_table_type) tableType
|
||||
andHandleId: (uint32_t) handleId;
|
||||
- (enum mapistore_error) getTable: (MAPIStoreTable **) tablePtr
|
||||
andRowCount: (uint32_t *) count
|
||||
tableType: (enum mapistore_table_type) tableType
|
||||
andHandleId: (uint32_t) handleId;
|
||||
|
||||
- (int) modifyPermissions: (struct PermissionData *) permissions
|
||||
withCount: (uint16_t) pcount
|
||||
andFlags: (int8_t) flags;
|
||||
- (enum mapistore_error) modifyPermissions: (struct PermissionData *) permissions
|
||||
withCount: (uint16_t) pcount
|
||||
andFlags: (int8_t) flags;
|
||||
- (enum mapistore_error) preloadMessageBodiesWithMIDs: (const struct UI8Array_r *) mids
|
||||
ofTableType: (enum mapistore_table_type) tableType;
|
||||
|
||||
|
|
|
@ -65,6 +65,17 @@
|
|||
|
||||
Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMessageTableK, MAPIStoreFolderTableK;
|
||||
|
||||
/* MAPI permissions */
|
||||
NSString *MAPIStoreRightReadItems = @"RightsReadItems";
|
||||
NSString *MAPIStoreRightCreateItems = @"RightsCreateItems";
|
||||
NSString *MAPIStoreRightEditOwn = @"RightsEditOwn";
|
||||
NSString *MAPIStoreRightEditAll = @"RightsEditAll";
|
||||
NSString *MAPIStoreRightDeleteOwn = @"RightsDeleteOwn";
|
||||
NSString *MAPIStoreRightDeleteAll = @"RightsDeleteAll";
|
||||
NSString *MAPIStoreRightCreateSubfolders = @"RightsCreateSubfolders";
|
||||
NSString *MAPIStoreRightFolderOwner = @"RightsFolderOwner";
|
||||
NSString *MAPIStoreRightFolderContact = @"RightsFolderContact";
|
||||
|
||||
@implementation MAPIStoreFolder
|
||||
|
||||
+ (void) initialize
|
||||
|
@ -365,10 +376,10 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
|
|||
return foundObject;
|
||||
}
|
||||
|
||||
- (int) openFolder: (MAPIStoreFolder **) childFolderPtr
|
||||
withFID: (uint64_t) fid
|
||||
- (enum mapistore_error) openFolder: (MAPIStoreFolder **) childFolderPtr
|
||||
withFID: (uint64_t) fid
|
||||
{
|
||||
int rc = MAPISTORE_ERR_NOT_FOUND;
|
||||
enum mapistore_error rc = MAPISTORE_ERR_NOT_FOUND;
|
||||
MAPIStoreFolder *childFolder;
|
||||
MAPIStoreMapping *mapping;
|
||||
NSString *childURL;
|
||||
|
@ -390,9 +401,9 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
|
|||
return rc;
|
||||
}
|
||||
|
||||
- (int) createFolder: (MAPIStoreFolder **) childFolderPtr
|
||||
withRow: (struct SRow *) aRow
|
||||
andFID: (uint64_t) fid
|
||||
- (enum mapistore_error) createFolder: (MAPIStoreFolder **) childFolderPtr
|
||||
withRow: (struct SRow *) aRow
|
||||
andFID: (uint64_t) fid
|
||||
{
|
||||
BOOL mapped;
|
||||
enum mapistore_error rc = MAPISTORE_SUCCESS;
|
||||
|
@ -447,7 +458,7 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
|
|||
return rc;
|
||||
}
|
||||
|
||||
- (int) deleteFolder
|
||||
- (enum mapistore_error) deleteFolder
|
||||
{
|
||||
// TODO: raise exception in case underlying delete fails?
|
||||
// [propsMessage delete];
|
||||
|
@ -458,11 +469,11 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getChildCount: (uint32_t *) rowCount
|
||||
ofTableType: (enum mapistore_table_type) tableType
|
||||
- (enum mapistore_error) getChildCount: (uint32_t *) rowCount
|
||||
ofTableType: (enum mapistore_table_type) tableType
|
||||
{
|
||||
NSArray *keys;
|
||||
int rc = MAPISTORE_SUCCESS;
|
||||
enum mapistore_error rc = MAPISTORE_SUCCESS;
|
||||
|
||||
//[self logWithFormat: @"METHOD '%s' (%d) -- tableType: %d",
|
||||
//__FUNCTION__, __LINE__, tableType];
|
||||
|
@ -483,16 +494,16 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
|
|||
return rc;
|
||||
}
|
||||
|
||||
- (int) openMessage: (MAPIStoreMessage **) messagePtr
|
||||
withMID: (uint64_t) mid
|
||||
forWriting: (BOOL) readWrite
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) openMessage: (MAPIStoreMessage **) messagePtr
|
||||
withMID: (uint64_t) mid
|
||||
forWriting: (BOOL) readWrite
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
{
|
||||
NSString *messageURL;
|
||||
MAPIStoreMapping *mapping;
|
||||
MAPIStoreMessage *message;
|
||||
SOGoUser *ownerUser;
|
||||
int rc = MAPISTORE_ERR_NOT_FOUND;
|
||||
enum mapistore_error rc = MAPISTORE_ERR_NOT_FOUND;
|
||||
|
||||
mapping = [self mapping];
|
||||
messageURL = [mapping urlFromID: mid];
|
||||
|
@ -523,9 +534,9 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
|
|||
return rc;
|
||||
}
|
||||
|
||||
- (int) createMessage: (MAPIStoreMessage **) messagePtr
|
||||
withMID: (uint64_t) mid
|
||||
isAssociated: (BOOL) isAssociated
|
||||
- (enum mapistore_error) createMessage: (MAPIStoreMessage **) messagePtr
|
||||
withMID: (uint64_t) mid
|
||||
isAssociated: (BOOL) isAssociated
|
||||
{
|
||||
enum mapistore_error rc;
|
||||
MAPIStoreMessage *message;
|
||||
|
@ -570,8 +581,8 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
|
|||
return rc;
|
||||
}
|
||||
|
||||
- (int) deleteMessageWithMID: (uint64_t) mid
|
||||
andFlags: (uint8_t) flags
|
||||
- (enum mapistore_error) deleteMessageWithMID: (uint64_t) mid
|
||||
andFlags: (uint8_t) flags
|
||||
{
|
||||
NSString *childURL;
|
||||
MAPIStoreMapping *mapping;
|
||||
|
@ -580,7 +591,7 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
|
|||
NSUInteger count, max;
|
||||
id msgObject;
|
||||
SOGoUser *ownerUser;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
/* flags that control the behaviour of the operation
|
||||
(MAPISTORE_SOFT_DELETE or MAPISTORE_PERMANENT_DELETE) */
|
||||
|
@ -597,7 +608,7 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
|
|||
|
||||
if ([[context activeUser] isEqual: ownerUser]
|
||||
|| (![message isKindOfClass: MAPIStoreFAIMessageK]
|
||||
&& [self subscriberCanDeleteMessages]))
|
||||
&& ([self subscriberCanDeleteMessages] || [message subscriberCanDeleteMessage])))
|
||||
{
|
||||
/* we ensure the table caches are loaded so that old and new state
|
||||
can be compared */
|
||||
|
@ -638,15 +649,15 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
|
|||
}
|
||||
|
||||
// private method
|
||||
- (int) _moveCopyMessageWithMID: (uint64_t) srcMid
|
||||
fromFolder: (MAPIStoreFolder *) sourceFolder
|
||||
withMID: (uint64_t) targetMid
|
||||
andChangeKey: (struct Binary_r *) targetChangeKey
|
||||
andPredecessorChangeList: (struct Binary_r *) targetPredecessorChangeList
|
||||
wantCopy: (uint8_t) wantCopy
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) _moveCopyMessageWithMID: (uint64_t) srcMid
|
||||
fromFolder: (MAPIStoreFolder *) sourceFolder
|
||||
withMID: (uint64_t) targetMid
|
||||
andChangeKey: (struct Binary_r *) targetChangeKey
|
||||
andPredecessorChangeList: (struct Binary_r *) targetPredecessorChangeList
|
||||
wantCopy: (uint8_t) wantCopy
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
MAPIStoreMessage *sourceMsg, *destMsg;
|
||||
//TALLOC_CTX *memCtx;
|
||||
struct SRow aRow;
|
||||
|
@ -695,16 +706,16 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
|
|||
return rc;
|
||||
}
|
||||
|
||||
- (int) moveCopyMessagesWithMIDs: (uint64_t *) srcMids
|
||||
andCount: (uint32_t) midCount
|
||||
fromFolder: (MAPIStoreFolder *) sourceFolder
|
||||
withMIDs: (uint64_t *) targetMids
|
||||
andChangeKeys: (struct Binary_r **) targetChangeKeys
|
||||
andPredecessorChangeLists: (struct Binary_r **) targetPredecessorChangeLists
|
||||
wantCopy: (uint8_t) wantCopy
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) moveCopyMessagesWithMIDs: (uint64_t *) srcMids
|
||||
andCount: (uint32_t) midCount
|
||||
fromFolder: (MAPIStoreFolder *) sourceFolder
|
||||
withMIDs: (uint64_t *) targetMids
|
||||
andChangeKeys: (struct Binary_r **) targetChangeKeys
|
||||
andPredecessorChangeLists: (struct Binary_r **) targetPredecessorChangeLists
|
||||
wantCopy: (uint8_t) wantCopy
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
int rc = MAPISTORE_SUCCESS;
|
||||
enum mapistore_error rc = MAPISTORE_SUCCESS;
|
||||
NSUInteger count;
|
||||
NSMutableArray *oldMessageURLs;
|
||||
NSString *oldMessageURL;
|
||||
|
@ -908,6 +919,11 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
|
|||
return nil;
|
||||
}
|
||||
|
||||
- (NSArray *) expandRoles: (NSArray *) roles
|
||||
{
|
||||
return roles;
|
||||
}
|
||||
|
||||
- (void) _modifyPermissionEntryForUser: (NSString *) user
|
||||
withRoles: (NSArray *) roles
|
||||
isAddition: (BOOL) isAddition
|
||||
|
@ -957,13 +973,13 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
|
|||
withIDs: newIDs];
|
||||
}
|
||||
|
||||
- (int) getDeletedFMIDs: (struct UI8Array_r **) fmidsPtr
|
||||
andCN: (uint64_t *) cnPtr
|
||||
fromChangeNumber: (uint64_t) changeNum
|
||||
inTableType: (enum mapistore_table_type) tableType
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getDeletedFMIDs: (struct UI8Array_r **) fmidsPtr
|
||||
andCN: (uint64_t *) cnPtr
|
||||
fromChangeNumber: (uint64_t) changeNum
|
||||
inTableType: (enum mapistore_table_type) tableType
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
NSString *baseURL, *format, *url;
|
||||
NSArray *keys;
|
||||
NSNumber *cnNbr;
|
||||
|
@ -1016,14 +1032,15 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
|
|||
return rc;
|
||||
}
|
||||
|
||||
- (int) getTable: (MAPIStoreTable **) tablePtr
|
||||
andRowCount: (uint32_t *) countPtr
|
||||
tableType: (enum mapistore_table_type) tableType
|
||||
andHandleId: (uint32_t) handleId
|
||||
- (enum mapistore_error) getTable: (MAPIStoreTable **) tablePtr
|
||||
andRowCount: (uint32_t *) countPtr
|
||||
tableType: (enum mapistore_table_type) tableType
|
||||
andHandleId: (uint32_t) handleId
|
||||
{
|
||||
int rc = MAPISTORE_SUCCESS;
|
||||
BOOL access;
|
||||
enum mapistore_error rc = MAPISTORE_SUCCESS;
|
||||
MAPIStoreTable *table;
|
||||
SOGoUser *ownerUser;
|
||||
SOGoUser *activeUser, *ownerUser;
|
||||
|
||||
if (tableType == MAPISTORE_MESSAGE_TABLE)
|
||||
table = [self messageTable];
|
||||
|
@ -1034,8 +1051,20 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
|
|||
else if (tableType == MAPISTORE_PERMISSIONS_TABLE)
|
||||
{
|
||||
ownerUser = [[self userContext] sogoUser];
|
||||
if ([[context activeUser] isEqual: ownerUser])
|
||||
table = [self permissionsTable];
|
||||
activeUser = [context activeUser];
|
||||
access = [activeUser isEqual: ownerUser];
|
||||
if (!access)
|
||||
{
|
||||
NSArray *roles;
|
||||
|
||||
roles = [[self aclFolder] aclsForUser: [activeUser login]];
|
||||
roles = [self expandRoles: roles]; // Not required here
|
||||
/* Check FolderVisible right to return the table */
|
||||
access = ([self exchangeRightsForRoles: roles] & RoleNone) != 0;
|
||||
}
|
||||
|
||||
if (access)
|
||||
table = [self permissionsTable];
|
||||
else
|
||||
rc = MAPISTORE_ERR_DENIED;
|
||||
}
|
||||
|
@ -1208,16 +1237,16 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
|
|||
// folderKeys = nil;
|
||||
}
|
||||
|
||||
- (int) getPidTagParentFolderId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagParentFolderId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongLongValue (memCtx, [container objectId]);
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagFolderId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagFolderId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongLongValue (memCtx, [self objectId]);
|
||||
|
||||
|
@ -1234,8 +1263,8 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
|
|||
0x00000010 Create Contents Table
|
||||
0x00000020 Create Associated Contents Table
|
||||
*/
|
||||
- (int) getPidTagAccess: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagAccess: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
uint32_t access = 0;
|
||||
SOGoUser *ownerUser;
|
||||
|
@ -1263,103 +1292,107 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagRights: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagRights: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
uint32_t rights = 0;
|
||||
SOGoUser *ownerUser;
|
||||
BOOL userIsOwner;
|
||||
SOGoUser *activeUser, *ownerUser;
|
||||
|
||||
ownerUser = [[self userContext] sogoUser];
|
||||
activeUser = [context activeUser];
|
||||
|
||||
userIsOwner = [[context activeUser] isEqual: ownerUser];
|
||||
if (userIsOwner || [self subscriberCanReadMessages])
|
||||
rights |= RightsReadItems;
|
||||
if (userIsOwner || [self subscriberCanCreateMessages])
|
||||
rights |= RightsCreateItems;
|
||||
if (userIsOwner || [self subscriberCanModifyMessages])
|
||||
rights |= RightsEditOwn | RightsEditAll;
|
||||
if (userIsOwner || [self subscriberCanDeleteMessages])
|
||||
rights |= RightsDeleteOwn | RightsDeleteAll;
|
||||
if ((userIsOwner || [self subscriberCanCreateSubFolders])
|
||||
&& [self supportsSubFolders])
|
||||
rights |= RightsCreateSubfolders;
|
||||
if (userIsOwner)
|
||||
rights |= RightsFolderOwner | RightsFolderContact;
|
||||
if ([activeUser isEqual: ownerUser])
|
||||
{
|
||||
rights = RightsReadItems | RightsCreateItems | RightsEditOwn | RightsEditAll
|
||||
| RightsDeleteOwn | RightsDeleteAll | RightsFolderOwner | RightsFolderContact | RoleNone;
|
||||
if ([self supportsSubFolders])
|
||||
rights |= RightsCreateSubfolders;
|
||||
}
|
||||
else
|
||||
{
|
||||
NSArray *roles;
|
||||
|
||||
roles = [[self aclFolder] aclsForUser: [activeUser login]];
|
||||
roles = [self expandRoles: roles];
|
||||
rights = [self exchangeRightsForRoles: roles];
|
||||
/* FreeBusySimple and FreeBusyDetailed does not apply here
|
||||
[MS-OXCFOLD] Section 2.2.2.2.2.8 */
|
||||
rights &= ~RightsFreeBusySimple & ~RightsFreeBusyDetailed;
|
||||
}
|
||||
|
||||
*data = MAPILongValue (memCtx, rights);
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagAccessControlListData: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagAccessControlListData: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [[NSData data] asBinaryInMemCtx: memCtx];
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagAttributeHidden: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagAttributeHidden: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getNo: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagAttributeSystem: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagAttributeSystem: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getNo: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagAttributeReadOnly: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagAttributeReadOnly: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getNo: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagSubfolders: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagSubfolders: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPIBoolValue (memCtx, [self supportsSubFolders] && [[self folderKeys] count] > 0);
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagFolderChildCount: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagFolderChildCount: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, [[self folderKeys] count]);
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagContentCount: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagContentCount: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, [[self messageKeys] count]);
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagContentUnreadCount: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagContentUnreadCount: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, 0);
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagAssociatedContentCount: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagAssociatedContentCount: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, [[self faiMessageKeys] count]);
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagDeletedCountTotal: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagDeletedCountTotal: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
/* TODO */
|
||||
*data = MAPILongValue (memCtx, 0);
|
||||
|
@ -1367,10 +1400,10 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagLocalCommitTimeMax: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagLocalCommitTimeMax: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
int rc = MAPISTORE_SUCCESS;
|
||||
enum mapistore_error rc = MAPISTORE_SUCCESS;
|
||||
NSDate *date;
|
||||
|
||||
date = [self lastMessageModificationTime];
|
||||
|
@ -1382,18 +1415,18 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
|
|||
return rc;
|
||||
}
|
||||
|
||||
- (int) getPidTagDefaultPostMessageClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagDefaultPostMessageClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [@"IPM.Note" asUnicodeInMemCtx: memCtx];
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getProperties: (struct mapistore_property_data *) data
|
||||
withTags: (enum MAPITAGS *) tags
|
||||
andCount: (uint16_t) columnCount
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getProperties: (struct mapistore_property_data *) data
|
||||
withTags: (enum MAPITAGS *) tags
|
||||
andCount: (uint16_t) columnCount
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
[dbFolder reloadIfNeeded];
|
||||
|
||||
|
@ -1403,11 +1436,11 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
|
|||
inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getProperty: (void **) data
|
||||
withTag: (enum MAPITAGS) propTag
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getProperty: (void **) data
|
||||
withTag: (enum MAPITAGS) propTag
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
id value;
|
||||
|
||||
value = [properties objectForKey: MAPIPropertyKey (propTag)];
|
||||
|
@ -1614,9 +1647,9 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
|
|||
[users release];
|
||||
}
|
||||
|
||||
- (int) modifyPermissions: (struct PermissionData *) permissions
|
||||
withCount: (uint16_t) pcount
|
||||
andFlags: (int8_t) flags
|
||||
- (enum mapistore_error) modifyPermissions: (struct PermissionData *) permissions
|
||||
withCount: (uint16_t) pcount
|
||||
andFlags: (int8_t) flags
|
||||
{
|
||||
NSUInteger count, propCount;
|
||||
struct PermissionData *currentPermission;
|
||||
|
@ -1626,6 +1659,22 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
|
|||
NSArray *permissionRoles;
|
||||
BOOL reset, isAdd = NO, isDelete = NO, isModify = NO;
|
||||
SOGoFolder *aclFolder;
|
||||
SOGoUser *activeUser, *ownerUser;
|
||||
|
||||
/* Check if we have permissions to modify the permissions.
|
||||
See [MS-OXCPERM] Section 3.2.5.2 for details */
|
||||
ownerUser = [[self userContext] sogoUser];
|
||||
activeUser = [context activeUser];
|
||||
if (![activeUser isEqual: ownerUser])
|
||||
{
|
||||
/* Check if we have FolderOwner right */
|
||||
NSArray *roles;
|
||||
|
||||
roles = [[self aclFolder] aclsForUser: [activeUser login]];
|
||||
roles = [self expandRoles: roles]; // Not required
|
||||
if (([self exchangeRightsForRoles: roles] & RightsFolderOwner) == 0)
|
||||
return MAPISTORE_ERR_DENIED;
|
||||
}
|
||||
|
||||
aclFolder = [self aclFolder];
|
||||
|
||||
|
|
|
@ -86,9 +86,9 @@ static Class NSNumberK;
|
|||
[super dealloc];
|
||||
}
|
||||
|
||||
- (int) deleteFolder
|
||||
- (enum mapistore_error) deleteFolder
|
||||
{
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
NSException *error;
|
||||
NSString *name;
|
||||
|
||||
|
@ -138,8 +138,8 @@ static Class NSNumberK;
|
|||
[sogoObject renameTo: newDisplayName];
|
||||
}
|
||||
|
||||
- (int) getPidTagDisplayName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagDisplayName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *displayName;
|
||||
Class cClass;
|
||||
|
@ -859,6 +859,7 @@ static Class NSNumberK;
|
|||
woContext = [[self userContext] woContext];
|
||||
activeUserRoles = [activeUser rolesForObject: sogoObject
|
||||
inContext: woContext];
|
||||
activeUserRoles = [self expandRoles: activeUserRoles];
|
||||
[activeUserRoles retain];
|
||||
}
|
||||
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
#ifndef MAPISTOREGCSMESSAGE_H
|
||||
#define MAPISTOREGCSMESSAGE_H
|
||||
|
||||
#import <SOGo/SOGoUser.h>
|
||||
|
||||
#import "MAPIStoreMessage.h"
|
||||
|
||||
@interface MAPIStoreGCSMessage : MAPIStoreMessage
|
||||
|
@ -30,6 +32,11 @@
|
|||
}
|
||||
|
||||
/* subclass helpers */
|
||||
|
||||
/* Return the message original creator */
|
||||
- (NSString *) creator;
|
||||
- (NSString *) owner;
|
||||
- (SOGoUser *) ownerUser;
|
||||
- (void) updateVersions;
|
||||
|
||||
@end
|
||||
|
|
|
@ -20,10 +20,12 @@
|
|||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSCalendarDate.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSValue.h>
|
||||
#import <NGObjWeb/SoSecurityManager.h>
|
||||
#import <NGObjWeb/WOContext+SoObjects.h>
|
||||
#import <NGExtensions/NSObject+Logs.h>
|
||||
#import <NGExtensions/NSObject+Values.h>
|
||||
#import <SOGo/SOGoContentObject.h>
|
||||
|
@ -35,6 +37,7 @@
|
|||
#import "MAPIStoreTypes.h"
|
||||
#import "MAPIStoreUserContext.h"
|
||||
#import "NSData+MAPIStore.h"
|
||||
#import "NSString+MAPIStore.h"
|
||||
|
||||
#import "MAPIStoreGCSMessage.h"
|
||||
|
||||
|
@ -54,76 +57,28 @@
|
|||
return [sogoObject lastModified];
|
||||
}
|
||||
|
||||
- (int) getPidTagAccess: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagCreatorName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
MAPIStoreContext *context;
|
||||
WOContext *woContext;
|
||||
SoSecurityManager *sm;
|
||||
MAPIStoreUserContext *userContext;
|
||||
uint32_t access;
|
||||
enum mapistore_error rc;
|
||||
NSString *creator;
|
||||
|
||||
context = [self context];
|
||||
userContext = [self userContext];
|
||||
if ([[context activeUser] isEqual: [userContext sogoUser]])
|
||||
access = 0x03;
|
||||
else
|
||||
creator = [self creator];
|
||||
if (creator)
|
||||
{
|
||||
sm = [SoSecurityManager sharedSecurityManager];
|
||||
woContext = [userContext woContext];
|
||||
|
||||
access = 0;
|
||||
if (![sm validatePermission: SoPerm_ChangeImagesAndFiles
|
||||
onObject: sogoObject
|
||||
inContext: woContext])
|
||||
access |= 1;
|
||||
if (![sm validatePermission: SoPerm_AccessContentsInformation
|
||||
onObject: sogoObject
|
||||
inContext: woContext])
|
||||
access |= 2;
|
||||
if (![sm validatePermission: SOGoPerm_DeleteObject
|
||||
onObject: sogoObject
|
||||
inContext: woContext])
|
||||
access |= 4;
|
||||
*data = [creator asUnicodeInMemCtx: memCtx];
|
||||
rc = MAPISTORE_SUCCESS;
|
||||
}
|
||||
*data = MAPILongValue (memCtx, access);
|
||||
else
|
||||
rc = MAPISTORE_ERR_NOT_FOUND;
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
return rc;
|
||||
}
|
||||
|
||||
- (int) getPidTagAccessLevel: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagChangeKey: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
MAPIStoreContext *context;
|
||||
MAPIStoreUserContext *userContext;
|
||||
WOContext *woContext;
|
||||
SoSecurityManager *sm;
|
||||
uint32_t accessLvl;
|
||||
|
||||
context = [self context];
|
||||
userContext = [self userContext];
|
||||
if ([[context activeUser] isEqual: [userContext sogoUser]])
|
||||
accessLvl = 1;
|
||||
else
|
||||
{
|
||||
sm = [SoSecurityManager sharedSecurityManager];
|
||||
woContext = [userContext woContext];
|
||||
if (![sm validatePermission: SoPerm_ChangeImagesAndFiles
|
||||
onObject: sogoObject
|
||||
inContext: woContext])
|
||||
accessLvl = 1;
|
||||
else
|
||||
accessLvl = 0;
|
||||
}
|
||||
*data = MAPILongValue (memCtx, accessLvl);
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagChangeKey: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
int rc = MAPISTORE_SUCCESS;
|
||||
enum mapistore_error rc = MAPISTORE_SUCCESS;
|
||||
NSData *changeKey;
|
||||
MAPIStoreGCSFolder *parentFolder;
|
||||
NSString *nameInContainer;
|
||||
|
@ -155,10 +110,10 @@
|
|||
return rc;
|
||||
}
|
||||
|
||||
- (int) getPidTagPredecessorChangeList: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagPredecessorChangeList: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
int rc = MAPISTORE_SUCCESS;
|
||||
enum mapistore_error rc = MAPISTORE_SUCCESS;
|
||||
NSData *changeList;
|
||||
MAPIStoreGCSFolder *parentFolder;
|
||||
|
||||
|
@ -241,4 +196,69 @@
|
|||
andPredecessorChangeList: predecessorChangeList];
|
||||
}
|
||||
|
||||
//----------------------
|
||||
// Sharing
|
||||
//----------------------
|
||||
|
||||
- (NSString *) creator
|
||||
{
|
||||
return [self owner];
|
||||
}
|
||||
|
||||
- (NSString *) owner
|
||||
{
|
||||
return [sogoObject ownerInContext: nil];
|
||||
}
|
||||
|
||||
- (SOGoUser *) ownerUser
|
||||
{
|
||||
NSString *ownerName;
|
||||
SOGoUser *owner = nil;
|
||||
|
||||
ownerName = [self owner];
|
||||
if ([ownerName length] != 0)
|
||||
owner = [SOGoUser userWithLogin: ownerName];
|
||||
|
||||
return owner;
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanModifyMessage
|
||||
{
|
||||
BOOL rc;
|
||||
NSArray *roles;
|
||||
|
||||
roles = [self activeUserRoles];
|
||||
|
||||
if (isNew)
|
||||
rc = [roles containsObject: SOGoRole_ObjectCreator];
|
||||
else
|
||||
rc = [roles containsObject: SOGoRole_ObjectEditor];
|
||||
|
||||
/* Check if the message is owned and it has permission to edit it */
|
||||
if (!rc && [roles containsObject: MAPIStoreRightEditOwn])
|
||||
rc = [[[container context] activeUser] isEqual: [self ownerUser]];
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanDeleteMessage
|
||||
{
|
||||
BOOL rc;
|
||||
NSArray *roles;
|
||||
|
||||
roles = [self activeUserRoles];
|
||||
rc = [roles containsObject: SOGoRole_ObjectEraser];
|
||||
|
||||
/* Check if the message is owned and it has permission to delete it */
|
||||
if (!rc && [roles containsObject: MAPIStoreRightDeleteOwn])
|
||||
{
|
||||
NSString *currentUser;
|
||||
|
||||
currentUser = [[container context] activeUser];
|
||||
rc = [currentUser isEqual: [self ownerUser]];
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -76,24 +76,24 @@
|
|||
ASSIGN (bodyPart, newBodyPart);
|
||||
}
|
||||
|
||||
- (int) getPidTagAttachMethod: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagAttachMethod: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, 0x00000001); // afByValue
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagAttachTag: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagAttachTag: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [[self mimeAttachTag] asBinaryInMemCtx: memCtx];
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagAttachSize: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagAttachSize: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
uint32_t longValue;
|
||||
|
||||
|
@ -103,8 +103,8 @@
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagRecordKey: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagRecordKey: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
static char recordBytes[] = {0xd9, 0xd8, 0x11, 0xa3, 0xe2, 0x90, 0x18, 0x41,
|
||||
0x9e, 0x04, 0x58, 0x46, 0x9d, 0x6d, 0x1b,
|
||||
|
@ -121,16 +121,16 @@
|
|||
return [bodyInfo filename];
|
||||
}
|
||||
|
||||
- (int) getPidTagAttachLongFilename: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagAttachLongFilename: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [[self _fileName] asUnicodeInMemCtx: memCtx];
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagAttachFilename: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagAttachFilename: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *fileName, *baseName, *ext;
|
||||
|
||||
|
@ -149,8 +149,8 @@
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagDisplayName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagDisplayName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *fileName;
|
||||
|
||||
|
@ -165,8 +165,8 @@
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagAttachContentId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagAttachContentId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [[bodyInfo objectForKey: @"bodyId"]
|
||||
asUnicodeInMemCtx: memCtx];
|
||||
|
@ -174,8 +174,8 @@
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagAttachMimeTag: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagAttachMimeTag: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *mimeTag, *fileName;
|
||||
|
||||
|
@ -193,8 +193,8 @@
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagAttachDataBinary: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagAttachDataBinary: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [[bodyPart fetchBLOBWithPeek: YES] asBinaryInMemCtx: memCtx];
|
||||
|
||||
|
|
|
@ -208,9 +208,9 @@ static Class SOGoMailFolderK, MAPIStoreMailFolderK, MAPIStoreOutboxFolderK;
|
|||
return rc;
|
||||
}
|
||||
|
||||
- (int) deleteFolder
|
||||
- (enum mapistore_error) deleteFolder
|
||||
{
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
NSException *error;
|
||||
NSString *name;
|
||||
|
||||
|
@ -234,8 +234,8 @@ static Class SOGoMailFolderK, MAPIStoreMailFolderK, MAPIStoreOutboxFolderK;
|
|||
return (rc == MAPISTORE_SUCCESS) ? [super deleteFolder] : rc;
|
||||
}
|
||||
|
||||
- (int) getPidTagContentUnreadCount: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagContentUnreadCount: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
EOQualifier *searchQualifier;
|
||||
uint32_t longValue;
|
||||
|
@ -250,8 +250,8 @@ static Class SOGoMailFolderK, MAPIStoreMailFolderK, MAPIStoreOutboxFolderK;
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagContainerClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagContainerClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [@"IPF.Note" asUnicodeInMemCtx: memCtx];
|
||||
|
||||
|
@ -1363,15 +1363,14 @@ _parseCOPYUID (NSString *line, NSArray **destUIDsP)
|
|||
// Move (or eventually copy) the mails identified by
|
||||
// "srcMids" from the source folder into this folder.
|
||||
//
|
||||
- (int) moveCopyMessagesWithMIDs: (uint64_t *) srcMids
|
||||
andCount: (uint32_t) midCount
|
||||
fromFolder: (MAPIStoreFolder *) sourceFolder
|
||||
withMIDs: (uint64_t *) targetMids
|
||||
andChangeKeys: (struct Binary_r **) targetChangeKeys
|
||||
andPredecessorChangeLists: (struct Binary_r **) targetPredecessorChangeLists
|
||||
wantCopy: (uint8_t) wantCopy
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
|
||||
- (enum mapistore_error) moveCopyMessagesWithMIDs: (uint64_t *) srcMids
|
||||
andCount: (uint32_t) midCount
|
||||
fromFolder: (MAPIStoreFolder *) sourceFolder
|
||||
withMIDs: (uint64_t *) targetMids
|
||||
andChangeKeys: (struct Binary_r **) targetChangeKeys
|
||||
andPredecessorChangeLists: (struct Binary_r **) targetPredecessorChangeLists
|
||||
wantCopy: (uint8_t) wantCopy
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NGImap4Connection *connection;
|
||||
NGImap4Client *client;
|
||||
|
@ -1657,7 +1656,7 @@ _parseCOPYUID (NSString *line, NSArray **destUIDsP)
|
|||
- (id) lookupMessage: (NSString *) messageKey
|
||||
{
|
||||
MAPIStoreMailMessage *message;
|
||||
NSData *rawBodyData;
|
||||
NSArray *rawBodyData;
|
||||
|
||||
message = [super lookupMessage: messageKey];
|
||||
if (message)
|
||||
|
@ -1731,73 +1730,31 @@ _parseCOPYUID (NSString *line, NSArray **destUIDsP)
|
|||
- (enum mapistore_error) preloadMessageBodiesWithKeys: (NSArray *) keys
|
||||
ofTableType: (enum mapistore_table_type) tableType
|
||||
{
|
||||
NSEnumerator *enumerator;
|
||||
NSUInteger max;
|
||||
NSString *messageKey;
|
||||
MAPIStoreMailMessage *message;
|
||||
NSMutableSet *bodyPartKeys;
|
||||
NSMutableDictionary *keyAssoc;
|
||||
NSDictionary *response;
|
||||
NSUInteger count, max;
|
||||
NSString *messageKey, *messageUid, *bodyPartKey;
|
||||
NGImap4Client *client;
|
||||
NSArray *fetch;
|
||||
NSData *bodyContent;
|
||||
NSArray* bodyContent;
|
||||
|
||||
if (tableType == MAPISTORE_MESSAGE_TABLE)
|
||||
if (tableType != MAPISTORE_MESSAGE_TABLE)
|
||||
return MAPISTORE_SUCCESS;
|
||||
|
||||
[bodyData removeAllObjects];
|
||||
|
||||
max = [keys count];
|
||||
if (max == 0)
|
||||
return MAPISTORE_SUCCESS;
|
||||
|
||||
enumerator = [keys objectEnumerator];
|
||||
while ((messageKey = [enumerator nextObject]))
|
||||
{
|
||||
[bodyData removeAllObjects];
|
||||
max = [keys count];
|
||||
|
||||
if (max > 0)
|
||||
message = [self lookupMessage: messageKey];
|
||||
if (message)
|
||||
{
|
||||
bodyPartKeys = [NSMutableSet setWithCapacity: max];
|
||||
|
||||
keyAssoc = [NSMutableDictionary dictionaryWithCapacity: max];
|
||||
for (count = 0; count < max; count++)
|
||||
bodyContent = [message getBodyContent];
|
||||
if (bodyContent)
|
||||
{
|
||||
messageKey = [keys objectAtIndex: count];
|
||||
message = [self lookupMessage: messageKey];
|
||||
if (message)
|
||||
{
|
||||
bodyPartKey = [message bodyContentPartKey];
|
||||
if (bodyPartKey)
|
||||
{
|
||||
[bodyPartKeys addObject: bodyPartKey];
|
||||
messageUid = [self messageUIDFromMessageKey: messageKey];
|
||||
/* If the bodyPartKey include peek, remove it as it is not returned
|
||||
as key in the IMAP server response.
|
||||
|
||||
IMAP conversation example:
|
||||
a4 UID FETCH 1 (UID BODY.PEEK[text])
|
||||
* 1 FETCH (UID 1 BODY[TEXT] {1677}
|
||||
*/
|
||||
bodyPartKey = [bodyPartKey stringByReplacingOccurrencesOfString: @"body.peek"
|
||||
withString: @"body"];
|
||||
[keyAssoc setObject: bodyPartKey forKey: messageUid];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
client = [[(SOGoMailFolder *) sogoObject imap4Connection] client];
|
||||
[client select: [sogoObject absoluteImap4Name]];
|
||||
response = [client fetchUids: [keyAssoc allKeys]
|
||||
parts: [bodyPartKeys allObjects]];
|
||||
fetch = [response objectForKey: @"fetch"];
|
||||
max = [fetch count];
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
response = [fetch objectAtIndex: count];
|
||||
messageUid = [[response objectForKey: @"uid"] stringValue];
|
||||
bodyPartKey = [keyAssoc objectForKey: messageUid];
|
||||
if (bodyPartKey)
|
||||
{
|
||||
bodyContent = [[response objectForKey: bodyPartKey]
|
||||
objectForKey: @"data"];
|
||||
if (bodyContent)
|
||||
{
|
||||
messageKey = [NSString stringWithFormat: @"%@.eml",
|
||||
messageUid];
|
||||
[bodyData setObject: bodyContent forKey: messageKey];
|
||||
}
|
||||
}
|
||||
[bodyData setObject: bodyContent forKey: messageKey];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1809,8 +1766,8 @@ _parseCOPYUID (NSString *line, NSArray **destUIDsP)
|
|||
|
||||
@implementation MAPIStoreOutboxFolder
|
||||
|
||||
- (int) getPidTagDisplayName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagDisplayName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [@"Outbox" asUnicodeInMemCtx: memCtx];
|
||||
|
||||
|
|
|
@ -25,8 +25,10 @@
|
|||
|
||||
#import "MAPIStoreMessage.h"
|
||||
|
||||
@class NSData;
|
||||
@class NSString;
|
||||
@class NSArray;
|
||||
@class NSMutableArray;
|
||||
@class NSMutableDictionary;
|
||||
|
||||
@class MAPIStoreAppointmentWrapper;
|
||||
@class MAPIStoreMailFolder;
|
||||
|
@ -37,12 +39,17 @@
|
|||
BOOL mailIsEvent;
|
||||
BOOL mailIsMeetingRequest;
|
||||
BOOL mailIsSharingObject;
|
||||
NSString *mimeKey;
|
||||
|
||||
NSMutableArray *bodyContentKeys;
|
||||
NSMutableDictionary *bodyPartsEncodings;
|
||||
NSMutableDictionary *bodyPartsCharsets;
|
||||
NSMutableDictionary *bodyPartsMimeTypes;
|
||||
NSMutableDictionary *bodyPartsMixed;
|
||||
|
||||
NSString *headerCharset;
|
||||
NSString *headerEncoding;
|
||||
NSString *headerMimeType;
|
||||
BOOL bodySetup;
|
||||
NSData *bodyContent;
|
||||
NSArray *bodyContent;
|
||||
BOOL fetchedAttachments;
|
||||
|
||||
MAPIStoreAppointmentWrapper *appointmentWrapper;
|
||||
|
@ -50,31 +57,31 @@
|
|||
|
||||
- (NSString *) subject;
|
||||
|
||||
- (int) getPidTagIconIndex: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidTagFlagStatus: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidTagIconIndex: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidTagFlagStatus: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
|
||||
- (int) getPidTagMessageFlags: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidTagFollowupIcon: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidTagImportance: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidTagReceivedByEmailAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidTagSenderEmailAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidTagDisplayTo: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidTagDisplayCc: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidTagDisplayBcc: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidTagMessageFlags: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidTagFollowupIcon: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidTagImportance: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidTagReceivedByEmailAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidTagSenderEmailAddress: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidTagDisplayTo: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidTagDisplayCc: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidTagDisplayBcc: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
|
||||
/* batch-mode helpers */
|
||||
- (NSString *) bodyContentPartKey;
|
||||
- (void) setBodyContentFromRawData: (NSData *) rawContent;
|
||||
- (void) setBodyContentFromRawData: (NSArray *) rawContent;
|
||||
- (NSArray *) getBodyContent;
|
||||
|
||||
@end
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -340,10 +340,10 @@ static Class MAPIStoreMailMessageK, NSDataK, NSStringK;
|
|||
[self cleanupCaches];
|
||||
}
|
||||
|
||||
- (int) getRow: (struct mapistore_property_data **) dataP
|
||||
withRowID: (uint32_t) rowId
|
||||
andQueryType: (enum mapistore_query_type) queryType
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getRow: (struct mapistore_property_data **) dataP
|
||||
withRowID: (uint32_t) rowId
|
||||
andQueryType: (enum mapistore_query_type) queryType
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
if (!fetchedCoreInfos)
|
||||
{
|
||||
|
@ -352,8 +352,8 @@ static Class MAPIStoreMailMessageK, NSDataK, NSStringK;
|
|||
prefetchCoreInfosForMessageKeys: [self restrictedChildKeys]];
|
||||
}
|
||||
|
||||
return [super getRow: dataP withRowID: rowId
|
||||
andQueryType: queryType inMemCtx: memCtx];
|
||||
return [super getRow: dataP withRowID: rowId
|
||||
andQueryType: queryType inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
@interface MAPIStoreMailVolatileMessage : MAPIStoreMessage
|
||||
|
||||
- (int) submitWithFlags: (enum SubmitFlags) flags;
|
||||
- (enum mapistore_error) submitWithFlags: (enum SubmitFlags) flags;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -290,17 +290,17 @@ static NSString *recTypes[] = { @"orig", @"to", @"cc", @"bcc" };
|
|||
: ULLONG_MAX);
|
||||
}
|
||||
|
||||
- (int) getPidTagMessageClass: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagMessageClass: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [@"IPM.Note" asUnicodeInMemCtx: memCtx];
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagChangeKey: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagChangeKey: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSData *changeKey;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
changeKey = [properties objectForKey: MAPIPropertyKey (PR_CHANGE_KEY)];
|
||||
if (changeKey)
|
||||
|
@ -1051,7 +1051,7 @@ MakeMessageBody (NSDictionary *mailProperties, NSDictionary *attachmentParts, NS
|
|||
return messageData;
|
||||
}
|
||||
|
||||
- (int) submitWithFlags: (enum SubmitFlags) flags
|
||||
- (enum mapistore_error) submitWithFlags: (enum SubmitFlags) flags
|
||||
{
|
||||
enum mapistore_error rc = MAPISTORE_SUCCESS;
|
||||
NSDictionary *recipients;
|
||||
|
|
|
@ -258,7 +258,7 @@ MAPIStoreMappingKeyFromId (uint64_t idNbr)
|
|||
if (oldURL != NULL)
|
||||
{
|
||||
[self errorWithFormat:
|
||||
@"url with idNbr already registered: (oldUrl='%@', newUrl='%@', id=x%.16"PRIx64")",
|
||||
@"url with idNbr already registered: (oldUrl='%@', newUrl='%@', id=0x%.16"PRIx64")",
|
||||
oldURL, urlString, idNbr];
|
||||
return NO;
|
||||
}
|
||||
|
@ -306,7 +306,7 @@ MAPIStoreMappingKeyFromId (uint64_t idNbr)
|
|||
}
|
||||
else
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"number of urls and ids do not match"];
|
||||
format: @"number of urls (%d) and ids (%d) do not match", max, [idNbrs count]];
|
||||
}
|
||||
|
||||
- (void) unregisterURLWithID: (uint64_t) idNbr
|
||||
|
|
|
@ -48,27 +48,28 @@
|
|||
- (void) getMessageData: (struct mapistore_message **) dataPtr
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
|
||||
- (int) modifyRecipientsWithRecipients: (struct mapistore_message_recipient *) recipients
|
||||
andCount: (NSUInteger) max
|
||||
andColumns: (struct SPropTagArray *) columns;
|
||||
- (enum mapistore_error) modifyRecipientsWithRecipients: (struct mapistore_message_recipient *) recipients
|
||||
andCount: (NSUInteger) max
|
||||
andColumns: (struct SPropTagArray *) columns;
|
||||
- (NSArray *) attachmentKeys;
|
||||
- (NSArray *) attachmentKeysMatchingQualifier: (EOQualifier *) qualifier
|
||||
andSortOrderings: (NSArray *) sortOrderings;
|
||||
- (id) lookupAttachment: (NSString *) childKey;
|
||||
|
||||
/* backend methods */
|
||||
- (int) createAttachment: (MAPIStoreAttachment **) attachmentPtr
|
||||
inAID: (uint32_t *) aidPtr;
|
||||
- (int) getAttachment: (MAPIStoreAttachment **) attachmentPtr
|
||||
withAID: (uint32_t) aid;
|
||||
- (int) getAttachmentTable: (MAPIStoreAttachmentTable **) tablePtr
|
||||
andRowCount: (uint32_t *) countPtr;
|
||||
- (enum mapistore_error) createAttachment: (MAPIStoreAttachment **) attachmentPtr
|
||||
inAID: (uint32_t *) aidPtr;
|
||||
- (enum mapistore_error) getAttachment: (MAPIStoreAttachment **) attachmentPtr
|
||||
withAID: (uint32_t) aid;
|
||||
- (enum mapistore_error) getAttachmentTable: (MAPIStoreAttachmentTable **) tablePtr
|
||||
andRowCount: (uint32_t *) countPtr;
|
||||
- (enum mapistore_error) setReadFlag: (uint8_t) flag;
|
||||
- (enum mapistore_error) saveMessage: (TALLOC_CTX *) memCtx;
|
||||
|
||||
- (NSArray *) activeContainerMessageTables;
|
||||
|
||||
- (NSArray *) activeUserRoles;
|
||||
- (NSArray *) expandRoles: (NSArray *) roles;
|
||||
|
||||
/* move & copy internal ops */
|
||||
- (void) copyToMessage: (MAPIStoreMessage *) newMessage inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
|
@ -82,6 +83,7 @@
|
|||
|
||||
- (BOOL) subscriberCanReadMessage;
|
||||
- (BOOL) subscriberCanModifyMessage;
|
||||
- (BOOL) subscriberCanDeleteMessage;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -276,9 +276,9 @@ rtf2html (NSData *compressedRTF)
|
|||
return recipientProperties;
|
||||
}
|
||||
|
||||
- (int) modifyRecipientsWithRecipients: (struct mapistore_message_recipient *) newRecipients
|
||||
andCount: (NSUInteger) max
|
||||
andColumns: (struct SPropTagArray *) columns;
|
||||
- (enum mapistore_error) modifyRecipientsWithRecipients: (struct mapistore_message_recipient *) newRecipients
|
||||
andCount: (NSUInteger) max
|
||||
andColumns: (struct SPropTagArray *) columns;
|
||||
{
|
||||
static NSString *recTypes[] = { @"orig", @"to", @"cc", @"bcc" };
|
||||
NSDictionary *recipientProperties;
|
||||
|
@ -318,7 +318,7 @@ rtf2html (NSData *compressedRTF)
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) addPropertiesFromRow: (struct SRow *) aRow
|
||||
- (enum mapistore_error) addPropertiesFromRow: (struct SRow *) aRow
|
||||
{
|
||||
enum mapistore_error rc;
|
||||
MAPIStoreContext *context;
|
||||
|
@ -397,11 +397,11 @@ rtf2html (NSData *compressedRTF)
|
|||
return newAttachment;
|
||||
}
|
||||
|
||||
- (int) createAttachment: (MAPIStoreAttachment **) attachmentPtr
|
||||
inAID: (uint32_t *) aidPtr
|
||||
- (enum mapistore_error) createAttachment: (MAPIStoreAttachment **) attachmentPtr
|
||||
inAID: (uint32_t *) aidPtr
|
||||
{
|
||||
MAPIStoreAttachment *attachment;
|
||||
int rc = MAPISTORE_SUCCESS;
|
||||
enum mapistore_error rc = MAPISTORE_SUCCESS;
|
||||
|
||||
attachment = [self createAttachment];
|
||||
if (attachment)
|
||||
|
@ -422,12 +422,12 @@ rtf2html (NSData *compressedRTF)
|
|||
return nil;
|
||||
}
|
||||
|
||||
- (int) getAttachment: (MAPIStoreAttachment **) attachmentPtr
|
||||
withAID: (uint32_t) aid
|
||||
- (enum mapistore_error) getAttachment: (MAPIStoreAttachment **) attachmentPtr
|
||||
withAID: (uint32_t) aid
|
||||
{
|
||||
MAPIStoreAttachment *attachment;
|
||||
NSArray *keys;
|
||||
int rc = MAPISTORE_ERR_NOT_FOUND;
|
||||
enum mapistore_error rc = MAPISTORE_ERR_NOT_FOUND;
|
||||
|
||||
keys = [self attachmentKeys];
|
||||
if (aid < [keys count])
|
||||
|
@ -443,11 +443,11 @@ rtf2html (NSData *compressedRTF)
|
|||
return rc;
|
||||
}
|
||||
|
||||
- (int) getAttachmentTable: (MAPIStoreAttachmentTable **) tablePtr
|
||||
andRowCount: (uint32_t *) countPtr
|
||||
- (enum mapistore_error) getAttachmentTable: (MAPIStoreAttachmentTable **) tablePtr
|
||||
andRowCount: (uint32_t *) countPtr
|
||||
{
|
||||
MAPIStoreAttachmentTable *attTable;
|
||||
int rc = MAPISTORE_SUCCESS;
|
||||
enum mapistore_error rc = MAPISTORE_SUCCESS;
|
||||
|
||||
attTable = [self attachmentTable];
|
||||
if (attTable)
|
||||
|
@ -547,7 +547,8 @@ rtf2html (NSData *compressedRTF)
|
|||
for (count = 0; count < max; count++)
|
||||
[[containerTables objectAtIndex: count] restrictedChildKeys];
|
||||
}
|
||||
|
||||
|
||||
/* TODO: Check the save process succeeded */
|
||||
[self save: memCtx];
|
||||
/* We make sure that any change-related properties are removed from the
|
||||
properties dictionary, to make sure that related methods will be
|
||||
|
@ -582,8 +583,8 @@ rtf2html (NSData *compressedRTF)
|
|||
}
|
||||
|
||||
/* getters */
|
||||
- (int) getPidTagInstID: (void **) data // TODO: DOUBT
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagInstID: (void **) data // TODO: DOUBT
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
/* we return a unique id based on the key */
|
||||
*data = MAPILongLongValue (memCtx, [[sogoObject nameInContainer] hash]);
|
||||
|
@ -591,22 +592,22 @@ rtf2html (NSData *compressedRTF)
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagInstanceNum: (void **) data // TODO: DOUBT
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagInstanceNum: (void **) data // TODO: DOUBT
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getLongZero: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagRowType: (void **) data // TODO: DOUBT
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagRowType: (void **) data // TODO: DOUBT
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, TBL_LEAF_ROW);
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagDepth: (void **) data // TODO: DOUBT
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagDepth: (void **) data // TODO: DOUBT
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongLongValue (memCtx, 0);
|
||||
|
||||
|
@ -623,8 +624,8 @@ rtf2html (NSData *compressedRTF)
|
|||
0x00000010 Create Contents Table
|
||||
0x00000020 Create Associated Contents Table
|
||||
*/
|
||||
- (int) getPidTagAccess: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagAccess: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
uint32_t access = 0;
|
||||
BOOL userIsOwner;
|
||||
|
@ -649,8 +650,7 @@ rtf2html (NSData *compressedRTF)
|
|||
if (userIsOwner
|
||||
|| ([self isKindOfClass: MAPIStoreEmbeddedMessageK]
|
||||
&& [mainMessage subscriberCanModifyMessage])
|
||||
|| [(MAPIStoreFolder *)
|
||||
[mainMessage container] subscriberCanDeleteMessages])
|
||||
|| [mainMessage subscriberCanDeleteMessage])
|
||||
access |= 0x04;
|
||||
|
||||
*data = MAPILongValue (memCtx, access);
|
||||
|
@ -664,8 +664,8 @@ rtf2html (NSData *compressedRTF)
|
|||
0x00000000 Read-Only
|
||||
0x00000001 Modify
|
||||
*/
|
||||
- (int) getPidTagAccessLevel: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagAccessLevel: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
uint32_t access = 0;
|
||||
BOOL userIsOwner;
|
||||
|
@ -684,20 +684,20 @@ rtf2html (NSData *compressedRTF)
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int ) getPidTagHasNamedProperties: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagHasNamedProperties: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getYes: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidSideEffects: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidSideEffects: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getLongZero: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidCurrentVersion: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidCurrentVersion: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
// *data = MAPILongValue (memCtx, 115608); // Outlook 11.5608
|
||||
*data = MAPILongValue (memCtx, 0x1ce3a); // Outlook 11.8330
|
||||
|
@ -705,34 +705,34 @@ rtf2html (NSData *compressedRTF)
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidLidCurrentVersionName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidCurrentVersionName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [@"11.0" asUnicodeInMemCtx: memCtx];
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidLidAutoProcessState: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidAutoProcessState: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, 0x00000000);
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagFolderId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagFolderId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongLongValue (memCtx, [container objectId]);
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagMid: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagMid: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
uint64_t obId;
|
||||
|
||||
obId = [self objectId];
|
||||
|
@ -747,24 +747,24 @@ rtf2html (NSData *compressedRTF)
|
|||
return rc;
|
||||
}
|
||||
|
||||
- (int) getPidTagMessageLocaleId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagMessageLocaleId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, 0x0409);
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagMessageFlags: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagMessageFlags: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, MSGFLAG_FROMME | MSGFLAG_READ | MSGFLAG_UNMODIFIED);
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagMessageSize: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagMessageSize: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
/* TODO: choose another name in SOGo for that method */
|
||||
*data = MAPILongValue (memCtx, [[sogoObject davContentLength] intValue]);
|
||||
|
@ -772,30 +772,30 @@ rtf2html (NSData *compressedRTF)
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagImportance: (void **) data // TODO -> subclass?
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagImportance: (void **) data // TODO -> subclass?
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, 1);
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagPriority: (void **) data // TODO -> subclass?
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagPriority: (void **) data // TODO -> subclass?
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getLongZero: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagSensitivity: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagSensitivity: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getLongZero: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagSubject: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagSubject: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
TALLOC_CTX *localMemCtx;
|
||||
char *prefix, *normalizedSubject;
|
||||
|
||||
|
@ -816,71 +816,71 @@ rtf2html (NSData *compressedRTF)
|
|||
return rc;
|
||||
}
|
||||
|
||||
- (int) getPidTagNormalizedSubject: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagNormalizedSubject: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
- (int) getPidTagOriginalSubject: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagOriginalSubject: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPidTagSubject: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagConversationTopic: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagConversationTopic: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPidTagNormalizedSubject: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagSubjectPrefix: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagSubjectPrefix: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getEmptyString: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagDeleteAfterSubmit: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagDeleteAfterSubmit: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getNo: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagDisplayTo: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagDisplayTo: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getEmptyString: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagDisplayCc: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagDisplayCc: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getEmptyString: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagDisplayBcc: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagDisplayBcc: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getEmptyString: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
// - (int) getPidTagOriginalDisplayTo: (void **) data
|
||||
// - (enum mapistore_error) getPidTagOriginalDisplayTo: (void **) data
|
||||
// {
|
||||
// return [self getPidTagDisplayTo: data];
|
||||
// }
|
||||
|
||||
// - (int) getPidTagOriginalDisplayCc: (void **) data
|
||||
// - (enum mapistore_error) getPidTagOriginalDisplayCc: (void **) data
|
||||
// {
|
||||
// return [self getPidTagDisplayCc: data];
|
||||
// }
|
||||
|
||||
// - (int) getPidTagOriginalDisplayBcc: (void **) data
|
||||
// - (enum mapistore_error) getPidTagOriginalDisplayBcc: (void **) data
|
||||
// {
|
||||
// return [self getPidTagDisplayBcc: data];
|
||||
// }
|
||||
|
||||
- (int) getPidTagLastModifierName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagLastModifierName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSURL *contextUrl;
|
||||
|
||||
|
@ -890,22 +890,22 @@ rtf2html (NSData *compressedRTF)
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagMessageClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagMessageClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
|
||||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
- (int) getPidTagOriginalMessageClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagOriginalMessageClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getProperty: data withTag: PidTagMessageClass inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagHasAttachments: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagHasAttachments: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPIBoolValue (memCtx,
|
||||
[[self attachmentKeys] count] > 0);
|
||||
|
@ -913,8 +913,8 @@ rtf2html (NSData *compressedRTF)
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagAssociated: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagAssociated: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getNo: data inMemCtx: memCtx];;
|
||||
}
|
||||
|
@ -981,20 +981,38 @@ rtf2html (NSData *compressedRTF)
|
|||
activeUserRoles = [[context activeUser]
|
||||
rolesForObject: sogoObject
|
||||
inContext: [userContext woContext]];
|
||||
/* We use in this library the roles as flags, so we expand high
|
||||
access rights with the lower ones */
|
||||
activeUserRoles = [self expandRoles: activeUserRoles];
|
||||
[activeUserRoles retain];
|
||||
}
|
||||
|
||||
return activeUserRoles;
|
||||
}
|
||||
|
||||
/* Expand current roles with lower access roles to transform them to
|
||||
flags */
|
||||
- (NSArray *) expandRoles: (NSArray *) roles
|
||||
{
|
||||
return roles;
|
||||
}
|
||||
|
||||
/* Can the current active user read the message? */
|
||||
- (BOOL) subscriberCanReadMessage
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
/* Can the current active user modify the message? */
|
||||
- (BOOL) subscriberCanModifyMessage
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
/* Can the current active user delete the message? */
|
||||
- (BOOL) subscriberCanDeleteMessage
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/* MAPIStoreNotesContext.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2010-2012 Inverse inc.
|
||||
* Copyright (C) 2016 Enrique J. Hernandez
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
*
|
||||
|
@ -30,13 +31,30 @@
|
|||
#undef DEBUG
|
||||
#include <mapistore/mapistore.h>
|
||||
|
||||
static Class MAPIStoreNotesFolderK;
|
||||
|
||||
@implementation MAPIStoreNotesContext
|
||||
|
||||
+ (void) initialize
|
||||
{
|
||||
MAPIStoreNotesFolderK = [MAPIStoreNotesFolder class];
|
||||
}
|
||||
|
||||
+ (NSString *) MAPIModuleName
|
||||
{
|
||||
return @"notes";
|
||||
}
|
||||
|
||||
+ (enum mapistore_context_role) MAPIContextRole
|
||||
{
|
||||
return MAPISTORE_NOTES_ROLE;
|
||||
}
|
||||
|
||||
- (Class) MAPIStoreFolderClass
|
||||
{
|
||||
return MAPIStoreNotesFolderK;
|
||||
}
|
||||
|
||||
+ (struct mapistore_contexts_list *) listContextsForUser: (NSString *) userName
|
||||
withIndexing: (struct indexing_context *) indexing
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
|
|
|
@ -30,8 +30,8 @@
|
|||
|
||||
@implementation MAPIStoreNotesFolder
|
||||
|
||||
- (int) getPidTagDefaultPostMessageClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagDefaultPostMessageClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [@"IPM.StickyNote" asUnicodeInMemCtx: memCtx];
|
||||
|
||||
|
|
|
@ -32,8 +32,8 @@
|
|||
|
||||
@implementation MAPIStoreNotesMessage
|
||||
|
||||
- (int) getPidTagIconIndex: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagIconIndex: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
/* see http://msdn.microsoft.com/en-us/library/cc815472.aspx */
|
||||
// *longValue = 0x00000300 for blue
|
||||
|
@ -46,7 +46,7 @@
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagMessageClass: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagMessageClass: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [@"IPM.StickyNote" asUnicodeInMemCtx: memCtx];
|
||||
|
||||
|
|
|
@ -68,27 +68,27 @@
|
|||
- (NSMutableDictionary *) properties;
|
||||
|
||||
/* ops */
|
||||
- (int) getProperties: (struct mapistore_property_data *) data
|
||||
withTags: (enum MAPITAGS *) tags
|
||||
andCount: (uint16_t) columnCount
|
||||
inMemCtx: (TALLOC_CTX *) localMemCtx;
|
||||
- (enum mapistore_error) getProperties: (struct mapistore_property_data *) data
|
||||
withTags: (enum MAPITAGS *) tags
|
||||
andCount: (uint16_t) columnCount
|
||||
inMemCtx: (TALLOC_CTX *) localMemCtx;
|
||||
|
||||
- (int) addPropertiesFromRow: (struct SRow *) aRow;
|
||||
- (enum mapistore_error) addPropertiesFromRow: (struct SRow *) aRow;
|
||||
|
||||
- (int) getProperty: (void **) data
|
||||
withTag: (enum MAPITAGS) propTag
|
||||
inMemCtx: (TALLOC_CTX *) localMemCtx;
|
||||
- (enum mapistore_error) getProperty: (void **) data
|
||||
withTag: (enum MAPITAGS) propTag
|
||||
inMemCtx: (TALLOC_CTX *) localMemCtx;
|
||||
|
||||
/* helper getters */
|
||||
- (NSData *) getReplicaKeyFromGlobCnt: (uint64_t) objectCnt;
|
||||
- (int) getReplicaKey: (void **) data
|
||||
fromGlobCnt: (uint64_t) objectCnt
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getReplicaKey: (void **) data
|
||||
fromGlobCnt: (uint64_t) objectCnt
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
|
||||
- (int) getPidTagCreationTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidTagLastModificationTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidTagCreationTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidTagLastModificationTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
|
||||
/* move and copy operations */
|
||||
- (void) copyPropertiesToObject: (MAPIStoreObject *) newObject inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
|
|
|
@ -150,15 +150,15 @@ static Class NSExceptionK, MAPIStoreFolderK;
|
|||
return properties;
|
||||
}
|
||||
|
||||
- (int) getProperty: (void **) data
|
||||
withTag: (enum MAPITAGS) propTag
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getProperty: (void **) data
|
||||
withTag: (enum MAPITAGS) propTag
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
MAPIStorePropertyGetter method = NULL;
|
||||
uint16_t propValue;
|
||||
SEL methodSel;
|
||||
id value;
|
||||
int rc = MAPISTORE_ERR_NOT_FOUND;
|
||||
enum mapistore_error rc = MAPISTORE_ERR_NOT_FOUND;
|
||||
NSUInteger count, max;
|
||||
|
||||
value = [properties objectForKey: MAPIPropertyKey (propTag)];
|
||||
|
@ -186,16 +186,16 @@ static Class NSExceptionK, MAPIStoreFolderK;
|
|||
return rc;
|
||||
}
|
||||
|
||||
- (int) getPidTagCreationTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagCreationTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [[self creationTime] asFileTimeInMemCtx: memCtx];
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagLastModificationTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagLastModificationTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [[self lastModificationTime] asFileTimeInMemCtx: memCtx];
|
||||
|
||||
|
@ -219,10 +219,10 @@ static Class NSExceptionK, MAPIStoreFolderK;
|
|||
return canGetProperty;
|
||||
}
|
||||
|
||||
- (int) getProperties: (struct mapistore_property_data *) data
|
||||
withTags: (enum MAPITAGS *) tags
|
||||
andCount: (uint16_t) columnCount
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getProperties: (struct mapistore_property_data *) data
|
||||
withTags: (enum MAPITAGS *) tags
|
||||
andCount: (uint16_t) columnCount
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
uint16_t count;
|
||||
|
||||
|
@ -239,7 +239,7 @@ static Class NSExceptionK, MAPIStoreFolderK;
|
|||
[proxies addObject: newProxy];
|
||||
}
|
||||
|
||||
- (int) addPropertiesFromRow: (struct SRow *) aRow
|
||||
- (enum mapistore_error) addPropertiesFromRow: (struct SRow *) aRow
|
||||
{
|
||||
struct SPropValue *cValue;
|
||||
NSUInteger counter;
|
||||
|
@ -298,9 +298,9 @@ static Class NSExceptionK, MAPIStoreFolderK;
|
|||
return replicaKey;
|
||||
}
|
||||
|
||||
- (int) getReplicaKey: (void **) data
|
||||
fromGlobCnt: (uint64_t) objectCnt
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getReplicaKey: (void **) data
|
||||
fromGlobCnt: (uint64_t) objectCnt
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [[self getReplicaKeyFromGlobCnt: objectCnt] asBinaryInMemCtx: memCtx];
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
MAPIStorePropertyGetter method;
|
||||
uint16_t propValue;
|
||||
SEL methodSel;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
propValue = (propTag & 0xffff0000) >> 16;
|
||||
methodSel = MAPIStoreSelectorForPropertyGetter (propValue);
|
||||
|
|
|
@ -84,16 +84,16 @@
|
|||
return memberId;
|
||||
}
|
||||
|
||||
- (int) getPidTagMemberId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagMemberId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongLongValue (memCtx, memberId);
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagEntryId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagEntryId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSData *entryId;
|
||||
struct mapistore_connection_info *connInfo;
|
||||
|
@ -110,8 +110,8 @@
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagMemberName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagMemberName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *displayName;
|
||||
|
||||
|
@ -127,13 +127,14 @@
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagMemberRights: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagMemberRights: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
uint32_t rights;
|
||||
NSArray *roles;
|
||||
|
||||
roles = [[(MAPIStoreFolder *) container aclFolder] aclsForUser: userId];
|
||||
roles = [(MAPIStoreFolder *) container expandRoles: roles];
|
||||
rights = [(MAPIStoreFolder *) container exchangeRightsForRoles: roles];
|
||||
|
||||
*data = MAPILongValue (memCtx, rights);
|
||||
|
|
|
@ -146,6 +146,8 @@ sogo_backend_init (void)
|
|||
NSUserDefaults *ud;
|
||||
SoProductRegistry *registry;
|
||||
char *argv[] = { SAMBA_PREFIX "/sbin/samba", NULL };
|
||||
NSString *debugLevel;
|
||||
uint8_t parentLogLevel;
|
||||
|
||||
GSRegisterCurrentThread();
|
||||
|
||||
|
@ -170,6 +172,11 @@ sogo_backend_init (void)
|
|||
|
||||
/* We force the plugin to base its configuration on the SOGo tree. */
|
||||
ud = [NSUserDefaults standardUserDefaults];
|
||||
|
||||
/* Ensure imap4Connection calls raise Exception if
|
||||
IMAP connection is not established. See NGImap4Connection.m */
|
||||
[ud setBool: YES forKey: @"SoIMAP4ExceptionsEnabled"];
|
||||
|
||||
if (!leakDebugging && [ud boolForKey: @"SOGoDebugLeaks"])
|
||||
{
|
||||
NSLog (@" leak debugging on");
|
||||
|
@ -178,6 +185,22 @@ sogo_backend_init (void)
|
|||
leakDebugging = YES;
|
||||
}
|
||||
|
||||
/* Set debug level according to samba */
|
||||
parentLogLevel = DEBUGLEVEL_CLASS[DBGC_ALL]; // FIXME: samba logger specific code
|
||||
if (parentLogLevel >= 4)
|
||||
debugLevel = @"DEBUG";
|
||||
else if (parentLogLevel >= 3)
|
||||
debugLevel = @"INFO";
|
||||
else if (parentLogLevel >= 2)
|
||||
debugLevel = @"WARN";
|
||||
else if (parentLogLevel >= 1)
|
||||
debugLevel = @"ERROR";
|
||||
else
|
||||
debugLevel = @"FATAL";
|
||||
OC_DEBUG(3, "[SOGo] Setting log level to %s", [debugLevel UTF8String]);
|
||||
[ud setObject: debugLevel forKey: @"NGLogDefaultLogLevel"];
|
||||
[ud synchronize];
|
||||
|
||||
registry = [SoProductRegistry sharedProductRegistry];
|
||||
[registry scanForProductsInDirectory: SOGO_BUNDLES_DIR];
|
||||
|
||||
|
@ -221,8 +244,13 @@ static void mapiapp_cleanup(void)
|
|||
\details Create a connection context to the sogo backend
|
||||
|
||||
\param mem_ctx pointer to the memory context
|
||||
\param conn_info pointer to the connection information available for this context
|
||||
(database connection, connected user, replica server info)
|
||||
\param indexing pointer to the indexing database connection
|
||||
\param uri pointer to the sogo path
|
||||
\param private_data pointer to the private backend context
|
||||
|
||||
\note the developer must free allocated private_data
|
||||
*/
|
||||
|
||||
static enum mapistore_error
|
||||
|
@ -233,7 +261,7 @@ sogo_backend_create_context(TALLOC_CTX *mem_ctx,
|
|||
{
|
||||
NSAutoreleasePool *pool;
|
||||
MAPIStoreContext *context;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
NS_CURRENT_THREAD_REGISTER();
|
||||
pool = [NSAutoreleasePool new];
|
||||
|
@ -268,7 +296,7 @@ sogo_backend_create_root_folder (const char *username,
|
|||
NSAutoreleasePool *pool;
|
||||
NSString *userName, *folderName;
|
||||
NSString *mapistoreUri;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
NS_CURRENT_THREAD_REGISTER();
|
||||
pool = [NSAutoreleasePool new];
|
||||
|
@ -303,7 +331,7 @@ sogo_backend_list_contexts(const char *username, struct indexing_context *indexi
|
|||
{
|
||||
NSAutoreleasePool *pool;
|
||||
NSString *userName;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
NS_CURRENT_THREAD_REGISTER();
|
||||
pool = [NSAutoreleasePool new];
|
||||
|
@ -349,7 +377,7 @@ sogo_context_get_path(void *backend_object, TALLOC_CTX *mem_ctx,
|
|||
struct MAPIStoreTallocWrapper *wrapper;
|
||||
NSAutoreleasePool *pool;
|
||||
MAPIStoreContext *context;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
if (backend_object)
|
||||
{
|
||||
|
@ -381,7 +409,7 @@ sogo_context_get_root_folder(void *backend_object, TALLOC_CTX *mem_ctx,
|
|||
NSAutoreleasePool *pool;
|
||||
MAPIStoreContext *context;
|
||||
MAPIStoreFolder *folder;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
if (backend_object)
|
||||
{
|
||||
|
@ -422,7 +450,7 @@ sogo_folder_open_folder(void *folder_object, TALLOC_CTX *mem_ctx, uint64_t fid,
|
|||
struct MAPIStoreTallocWrapper *wrapper;
|
||||
NSAutoreleasePool *pool;
|
||||
MAPIStoreFolder *folder, *childFolder;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
if (folder_object)
|
||||
{
|
||||
|
@ -464,7 +492,7 @@ sogo_folder_create_folder(void *folder_object, TALLOC_CTX *mem_ctx,
|
|||
struct MAPIStoreTallocWrapper *wrapper;
|
||||
NSAutoreleasePool *pool;
|
||||
MAPIStoreFolder *folder, *childFolder;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
if (folder_object)
|
||||
{
|
||||
|
@ -505,7 +533,7 @@ sogo_folder_delete(void *folder_object)
|
|||
struct MAPIStoreTallocWrapper *wrapper;
|
||||
NSAutoreleasePool *pool;
|
||||
MAPIStoreFolder *folder;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
if (folder_object)
|
||||
{
|
||||
|
@ -535,7 +563,7 @@ sogo_folder_get_child_count(void *folder_object, enum mapistore_table_type table
|
|||
struct MAPIStoreTallocWrapper *wrapper;
|
||||
NSAutoreleasePool *pool;
|
||||
MAPIStoreFolder *folder;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
if (folder_object)
|
||||
{
|
||||
|
@ -569,7 +597,7 @@ sogo_folder_open_message(void *folder_object,
|
|||
NSAutoreleasePool *pool;
|
||||
MAPIStoreFolder *folder;
|
||||
MAPIStoreMessage *message;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
if (folder_object)
|
||||
{
|
||||
|
@ -609,7 +637,7 @@ sogo_folder_create_message(void *folder_object,
|
|||
NSAutoreleasePool *pool;
|
||||
MAPIStoreFolder *folder;
|
||||
MAPIStoreMessage *message;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
if (folder_object)
|
||||
{
|
||||
|
@ -643,7 +671,7 @@ sogo_folder_delete_message(void *folder_object, uint64_t mid, uint8_t flags)
|
|||
struct MAPIStoreTallocWrapper *wrapper;
|
||||
NSAutoreleasePool *pool;
|
||||
MAPIStoreFolder *folder;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
if (folder_object)
|
||||
{
|
||||
|
@ -680,7 +708,7 @@ sogo_folder_move_copy_messages(void *folder_object,
|
|||
MAPIStoreFolder *sourceFolder, *targetFolder;
|
||||
NSAutoreleasePool *pool;
|
||||
struct MAPIStoreTallocWrapper *wrapper;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
if (folder_object)
|
||||
{
|
||||
|
@ -723,7 +751,7 @@ sogo_folder_move_folder(void *folder_object, void *target_folder_object,
|
|||
MAPIStoreFolder *moveFolder, *targetFolder;
|
||||
NSString *newFolderName;
|
||||
struct MAPIStoreTallocWrapper *wrapper;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
if (folder_object)
|
||||
{
|
||||
|
@ -771,7 +799,7 @@ sogo_folder_copy_folder(void *folder_object, void *target_folder_object, TALLOC_
|
|||
MAPIStoreFolder *copyFolder, *targetFolder;
|
||||
NSString *newFolderName;
|
||||
struct MAPIStoreTallocWrapper *wrapper;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
if (folder_object)
|
||||
{
|
||||
|
@ -813,7 +841,7 @@ sogo_folder_get_deleted_fmids(void *folder_object, TALLOC_CTX *mem_ctx,
|
|||
struct MAPIStoreTallocWrapper *wrapper;
|
||||
NSAutoreleasePool *pool;
|
||||
MAPIStoreFolder *folder;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
if (folder_object)
|
||||
{
|
||||
|
@ -850,7 +878,7 @@ sogo_folder_open_table(void *folder_object, TALLOC_CTX *mem_ctx,
|
|||
NSAutoreleasePool *pool;
|
||||
MAPIStoreFolder *folder;
|
||||
MAPIStoreTable *table;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
if (folder_object)
|
||||
{
|
||||
|
@ -887,7 +915,7 @@ sogo_folder_modify_permissions(void *folder_object, uint8_t flags,
|
|||
struct MAPIStoreTallocWrapper *wrapper;
|
||||
NSAutoreleasePool *pool;
|
||||
MAPIStoreFolder *folder;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
if (folder_object)
|
||||
{
|
||||
|
@ -919,7 +947,7 @@ sogo_folder_preload_message_bodies(void *folder_object, enum mapistore_table_typ
|
|||
struct MAPIStoreTallocWrapper *wrapper;
|
||||
NSAutoreleasePool *pool;
|
||||
MAPIStoreFolder *folder;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
if (folder_object)
|
||||
{
|
||||
|
@ -952,7 +980,7 @@ sogo_message_get_message_data(void *message_object,
|
|||
struct MAPIStoreTallocWrapper *wrapper;
|
||||
NSAutoreleasePool *pool;
|
||||
MAPIStoreMessage *message;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
if (message_object)
|
||||
{
|
||||
|
@ -985,7 +1013,7 @@ sogo_message_create_attachment (void *message_object, TALLOC_CTX *mem_ctx, void
|
|||
NSAutoreleasePool *pool;
|
||||
MAPIStoreMessage *message;
|
||||
MAPIStoreAttachment *attachment;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
if (message_object)
|
||||
{
|
||||
|
@ -1019,7 +1047,7 @@ sogo_message_open_attachment (void *message_object, TALLOC_CTX *mem_ctx,
|
|||
NSAutoreleasePool *pool;
|
||||
MAPIStoreMessage *message;
|
||||
MAPIStoreAttachment *attachment;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
if (message_object)
|
||||
{
|
||||
|
@ -1052,7 +1080,7 @@ sogo_message_get_attachment_table (void *message_object, TALLOC_CTX *mem_ctx, vo
|
|||
NSAutoreleasePool *pool;
|
||||
MAPIStoreMessage *message;
|
||||
MAPIStoreAttachmentTable *table;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
if (message_object)
|
||||
{
|
||||
|
@ -1088,7 +1116,7 @@ sogo_message_modify_recipients (void *message_object,
|
|||
struct MAPIStoreTallocWrapper *wrapper;
|
||||
NSAutoreleasePool *pool;
|
||||
MAPIStoreMessage *message;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
if (message_object)
|
||||
{
|
||||
|
@ -1150,7 +1178,7 @@ sogo_message_save (void *message_object, TALLOC_CTX *mem_ctx)
|
|||
struct MAPIStoreTallocWrapper *wrapper;
|
||||
NSAutoreleasePool *pool;
|
||||
MAPIStoreMessage *message;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
if (message_object)
|
||||
{
|
||||
|
@ -1180,7 +1208,7 @@ sogo_message_submit (void *message_object, enum SubmitFlags flags)
|
|||
struct MAPIStoreTallocWrapper *wrapper;
|
||||
NSAutoreleasePool *pool;
|
||||
MAPIStoreMailVolatileMessage *message;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
if (message_object)
|
||||
{
|
||||
|
@ -1215,7 +1243,7 @@ sogo_message_attachment_open_embedded_message (void *attachment_object,
|
|||
NSAutoreleasePool *pool;
|
||||
MAPIStoreAttachment *attachment;
|
||||
MAPIStoreEmbeddedMessage *message;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
if (attachment_object)
|
||||
{
|
||||
|
@ -1254,7 +1282,7 @@ sogo_message_attachment_create_embedded_message (void *attachment_object,
|
|||
NSAutoreleasePool *pool;
|
||||
MAPIStoreAttachment *attachment;
|
||||
MAPIStoreEmbeddedMessage *message;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
if (attachment_object)
|
||||
{
|
||||
|
@ -1288,7 +1316,7 @@ static enum mapistore_error sogo_table_get_available_properties(void *table_obje
|
|||
struct MAPIStoreTallocWrapper *wrapper;
|
||||
NSAutoreleasePool *pool;
|
||||
MAPIStoreTable *table;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
if (table_object)
|
||||
{
|
||||
|
@ -1318,7 +1346,7 @@ sogo_table_set_columns (void *table_object, uint16_t count, enum MAPITAGS *prope
|
|||
struct MAPIStoreTallocWrapper *wrapper;
|
||||
NSAutoreleasePool *pool;
|
||||
MAPIStoreTable *table;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
if (table_object)
|
||||
{
|
||||
|
@ -1349,7 +1377,7 @@ sogo_table_set_restrictions (void *table_object, struct mapi_SRestriction *restr
|
|||
struct MAPIStoreTallocWrapper *wrapper;
|
||||
NSAutoreleasePool *pool;
|
||||
MAPIStoreTable *table;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
if (table_object)
|
||||
{
|
||||
|
@ -1382,7 +1410,7 @@ sogo_table_set_sort_order (void *table_object, struct SSortOrderSet *sort_order,
|
|||
struct MAPIStoreTallocWrapper *wrapper;
|
||||
NSAutoreleasePool *pool;
|
||||
MAPIStoreTable *table;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
if (table_object)
|
||||
{
|
||||
|
@ -1417,7 +1445,7 @@ sogo_table_get_row (void *table_object, TALLOC_CTX *mem_ctx,
|
|||
struct MAPIStoreTallocWrapper *wrapper;
|
||||
NSAutoreleasePool *pool;
|
||||
MAPIStoreTable *table;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
if (table_object)
|
||||
{
|
||||
|
@ -1450,7 +1478,7 @@ sogo_table_get_row_count (void *table_object,
|
|||
struct MAPIStoreTallocWrapper *wrapper;
|
||||
NSAutoreleasePool *pool;
|
||||
MAPIStoreTable *table;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
if (table_object)
|
||||
{
|
||||
|
@ -1481,7 +1509,7 @@ sogo_table_handle_destructor (void *table_object, uint32_t handle_id)
|
|||
struct MAPIStoreTallocWrapper *wrapper;
|
||||
NSAutoreleasePool *pool;
|
||||
MAPIStoreTable *table;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
if (table_object)
|
||||
{
|
||||
|
@ -1513,7 +1541,7 @@ static enum mapistore_error sogo_properties_get_available_properties(void *objec
|
|||
struct MAPIStoreTallocWrapper *wrapper;
|
||||
NSAutoreleasePool *pool;
|
||||
MAPIStoreObject *propObject;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
if (object)
|
||||
{
|
||||
|
@ -1546,7 +1574,7 @@ sogo_properties_get_properties (void *object,
|
|||
struct MAPIStoreTallocWrapper *wrapper;
|
||||
NSAutoreleasePool *pool;
|
||||
MAPIStoreObject *propObject;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
if (object)
|
||||
{
|
||||
|
@ -1578,7 +1606,7 @@ sogo_properties_set_properties (void *object, struct SRow *aRow)
|
|||
struct MAPIStoreTallocWrapper *wrapper;
|
||||
NSAutoreleasePool *pool;
|
||||
MAPIStoreObject *propObject;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
if (object)
|
||||
{
|
||||
|
@ -1656,10 +1684,10 @@ sogo_manager_generate_uri (TALLOC_CTX *mem_ctx,
|
|||
|
||||
\return MAPISTORE_SUCCESS on success, otherwise MAPISTORE error
|
||||
*/
|
||||
int mapistore_init_backend(void)
|
||||
enum mapistore_error mapistore_init_backend(void)
|
||||
{
|
||||
struct mapistore_backend backend;
|
||||
int ret;
|
||||
enum mapistore_error ret;
|
||||
static BOOL registered = NO;
|
||||
|
||||
if (registered)
|
||||
|
|
|
@ -65,18 +65,18 @@
|
|||
- (uint64_t) objectId;
|
||||
|
||||
/* implemented getters */
|
||||
- (int) getPidTagDisplayName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidTagSearchKey: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidTagGenerateExchangeViews: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidTagParentSourceKey: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidTagSourceKey: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidTagChangeKey: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidTagDisplayName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidTagSearchKey: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidTagGenerateExchangeViews: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidTagParentSourceKey: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidTagSourceKey: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidTagChangeKey: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
|
||||
/* subclasses */
|
||||
- (uint64_t) objectVersion;
|
||||
|
|
|
@ -136,16 +136,16 @@ static Class MAPIStoreFolderK;
|
|||
}
|
||||
|
||||
/* getters */
|
||||
- (int) getPidTagDisplayName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagDisplayName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [[sogoObject displayName] asUnicodeInMemCtx: memCtx];
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagSearchKey: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagSearchKey: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *stringValue;
|
||||
|
||||
|
@ -156,31 +156,31 @@ static Class MAPIStoreFolderK;
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagGenerateExchangeViews: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagGenerateExchangeViews: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getNo: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagParentSourceKey: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagParentSourceKey: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getReplicaKey: data fromGlobCnt: [container objectId] >> 16
|
||||
inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagSourceKey: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagSourceKey: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getReplicaKey: data fromGlobCnt: [self objectId] >> 16
|
||||
inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
/* helper getters */
|
||||
- (int) getPidTagChangeKey: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagChangeKey: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
uint64_t obVersion;
|
||||
|
||||
obVersion = [self objectVersion];
|
||||
|
@ -193,10 +193,10 @@ static Class MAPIStoreFolderK;
|
|||
return rc;
|
||||
}
|
||||
|
||||
- (int) getPidTagChangeNumber: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagChangeNumber: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
struct mapistore_connection_info *connInfo;
|
||||
uint64_t obVersion;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* MAPIStoreSharingMessage.h - this file is part of SOGo-OpenChange
|
||||
*
|
||||
* Copyright (C) 2015 Enrique J. Hernández
|
||||
* Copyright (C) 2015-2016 Enrique J. Hernández
|
||||
*
|
||||
* Author: Enrique J. Hernández <ejhernandez@zentyal.com>
|
||||
*
|
||||
|
@ -39,58 +39,58 @@
|
|||
fromMessage: (MAPIStoreMailMessage *) msg;
|
||||
|
||||
/* getters */
|
||||
- (int) getPidLidSharingCapabilities: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidNameXSharingCapabilities: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidSharingConfigurationUrl: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidNameXSharingConfigUrl: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidSharingFlavor: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidNameXSharingFlavor: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidSharingInitiatorEntryId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidSharingInitiatorName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidSharingInitiatorSmtp: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidSharingLocalType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidNameXSharingLocalType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidSharingProviderGuid: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidNameXSharingProviderGuid: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidSharingProviderName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidNameXSharingProviderName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidSharingProviderUrl: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidNameXSharingProviderUrl: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidSharingRemoteName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidNameXSharingRemoteName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidSharingRemoteStoreUid: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidNameXSharingRemoteStoreUid: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidSharingRemoteType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidTypeXSharingRemoteType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidSharingResponseTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidLidSharingResponseType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getPidNameContentClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidSharingCapabilities: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidNameXSharingCapabilities: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidSharingConfigurationUrl: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidNameXSharingConfigUrl: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidSharingFlavor: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidNameXSharingFlavor: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidSharingInitiatorEntryId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidSharingInitiatorName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidSharingInitiatorSmtp: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidSharingLocalType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidNameXSharingLocalType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidSharingProviderGuid: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidNameXSharingProviderGuid: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidSharingProviderName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidNameXSharingProviderName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidSharingProviderUrl: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidNameXSharingProviderUrl: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidSharingRemoteName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidNameXSharingRemoteName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidSharingRemoteStoreUid: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidNameXSharingRemoteStoreUid: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidSharingRemoteType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidTypeXSharingRemoteType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidSharingResponseTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidLidSharingResponseType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getPidNameContentClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
|
||||
/* Save */
|
||||
- (void) saveWithMessage: (MAPIStoreMailMessage *) msg
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* MAPIStoreSharingMessage.m - this file is part of SOGo-OpenChange
|
||||
*
|
||||
* Copyright (C) 2015 Enrique J. Hernández
|
||||
* Copyright (C) 2015-2016 Enrique J. Hernández
|
||||
*
|
||||
* Author: Enrique J. Hernández <ejhernandez@zentyal.com>
|
||||
*
|
||||
|
@ -108,8 +108,8 @@
|
|||
|
||||
}
|
||||
|
||||
- (int) getPidLidSharingCapabilities: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidSharingCapabilities: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
|
||||
enum mapistore_error rc = MAPISTORE_ERR_NOT_FOUND;
|
||||
|
@ -125,8 +125,8 @@
|
|||
return rc;
|
||||
}
|
||||
|
||||
- (int) getPidNameXSharingCapabilities: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidNameXSharingCapabilities: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
|
||||
enum mapistore_error rc = MAPISTORE_ERR_NOT_FOUND;
|
||||
|
@ -143,22 +143,22 @@
|
|||
return rc;
|
||||
}
|
||||
|
||||
- (int) getPidLidSharingConfigurationUrl: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidSharingConfigurationUrl: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
|
||||
*data = [@"" asUnicodeInMemCtx: memCtx];
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidNameXSharingConfigUrl: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidNameXSharingConfigUrl: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPidLidSharingConfigurationUrl: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidSharingFlavor: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidSharingFlavor: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
/* See [MS-OXSHARE] Section 2.2.2.5 for details */
|
||||
enum mapistore_error rc = MAPISTORE_ERR_NOT_FOUND;
|
||||
|
@ -206,8 +206,8 @@
|
|||
return rc;
|
||||
}
|
||||
|
||||
- (int) getPidNameXSharingFlavor: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidNameXSharingFlavor: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
enum mapistore_error rc = MAPISTORE_ERR_NOT_FOUND;
|
||||
id value;
|
||||
|
@ -223,8 +223,8 @@
|
|||
return rc;
|
||||
}
|
||||
|
||||
- (int) getPidLidSharingInitiatorEntryId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidSharingInitiatorEntryId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
enum mapistore_error rc = MAPISTORE_ERR_NOT_FOUND;
|
||||
id value;
|
||||
|
@ -244,38 +244,38 @@
|
|||
return rc;
|
||||
}
|
||||
|
||||
- (int) getPidLidSharingInitiatorName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidSharingInitiatorName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getStringProperty: @"x-ms-sharing-initiatorname"
|
||||
inData: data
|
||||
inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidSharingInitiatorSmtp: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidSharingInitiatorSmtp: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getStringProperty: @"x-ms-sharing-initiatorsmtp"
|
||||
inData: data
|
||||
inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidSharingLocalType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidSharingLocalType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getStringProperty: @"x-ms-sharing-localtype"
|
||||
inData: data
|
||||
inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidNameXSharingLocalType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidNameXSharingLocalType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPidLidSharingLocalType: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidSharingProviderGuid: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidSharingProviderGuid: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
const unsigned char providerGuidBytes[] = {0xAE, 0xF0, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46};
|
||||
|
@ -284,15 +284,15 @@
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidNameXSharingProviderGuid: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidNameXSharingProviderGuid: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [@"AEF0060000000000C000000000000046" asUnicodeInMemCtx: memCtx];
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidLidSharingProviderName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidSharingProviderName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
|
||||
return [self _getStringProperty: @"x-ms-sharing-providername"
|
||||
|
@ -300,84 +300,84 @@
|
|||
inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidNameXSharingProviderName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidNameXSharingProviderName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPidLidSharingProviderName: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidSharingProviderUrl: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidSharingProviderUrl: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getStringProperty: @"x-ms-sharing-providerurl"
|
||||
inData: data
|
||||
inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidNameXSharingProviderUrl: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidNameXSharingProviderUrl: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPidLidSharingProviderUrl: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidSharingRemoteName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidSharingRemoteName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getStringProperty: @"x-ms-sharing-remotename"
|
||||
inData: data
|
||||
inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidNameXSharingRemoteName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidNameXSharingRemoteName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPidLidSharingRemoteName: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidSharingRemoteStoreUid: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidSharingRemoteStoreUid: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getStringProperty: @"x-ms-sharing-remotestoreuid"
|
||||
inData: data
|
||||
inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidNameXSharingRemoteStoreUid: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidNameXSharingRemoteStoreUid: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPidLidSharingRemoteStoreUid: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidSharingRemoteType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidSharingRemoteType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getStringProperty: @"x-ms-sharing-remotetype"
|
||||
inData: data
|
||||
inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTypeXSharingRemoteType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTypeXSharingRemoteType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPidLidSharingRemoteType: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidSharingRemoteUid: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidSharingRemoteUid: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self _getStringProperty: @"x-ms-sharing-remoteuid"
|
||||
inData: data
|
||||
inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidUidXSharingRemoteUid: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidUidXSharingRemoteUid: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPidLidSharingRemoteUid: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidSharingResponseTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidSharingResponseTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
enum mapistore_error rc = MAPISTORE_ERR_NOT_FOUND;
|
||||
id value;
|
||||
|
@ -403,8 +403,8 @@
|
|||
return rc;
|
||||
}
|
||||
|
||||
- (int) getPidLidSharingResponseType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidSharingResponseType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
|
||||
enum mapistore_error rc = MAPISTORE_ERR_NOT_FOUND;
|
||||
|
@ -423,8 +423,8 @@
|
|||
return rc;
|
||||
}
|
||||
|
||||
- (int) getPidNameContentClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidNameContentClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = talloc_strdup (memCtx, "Sharing");
|
||||
return MAPISTORE_SUCCESS;
|
||||
|
|
|
@ -88,17 +88,17 @@ typedef enum {
|
|||
|
||||
- (void) cleanupCaches;
|
||||
|
||||
- (int) getAvailableProperties: (struct SPropTagArray **) propertiesP
|
||||
inMemCtx: (TALLOC_CTX *) localMemCtx;
|
||||
- (enum mapistore_error) 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 **) dataP
|
||||
withRowID: (uint32_t) rowId
|
||||
andQueryType: (enum mapistore_query_type) queryType
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) getRowCount: (uint32_t *) countP
|
||||
withQueryType: (enum mapistore_query_type) queryType;
|
||||
- (enum mapistore_error) setColumns: (enum MAPITAGS *) newColumns
|
||||
withCount: (uint16_t) newColumCount;
|
||||
- (enum mapistore_error) getRow: (struct mapistore_property_data **) dataP
|
||||
withRowID: (uint32_t) rowId
|
||||
andQueryType: (enum mapistore_query_type) queryType
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getRowCount: (uint32_t *) countP
|
||||
withQueryType: (enum mapistore_query_type) queryType;
|
||||
|
||||
/* helpers */
|
||||
|
||||
|
|
|
@ -366,8 +366,8 @@ static Class NSDataK, NSStringK;
|
|||
currentRow = (uint32_t) -1;
|
||||
}
|
||||
|
||||
- (int) getAvailableProperties: (struct SPropTagArray **) propertiesP
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getAvailableProperties: (struct SPropTagArray **) propertiesP
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [[isa childObjectClass] getAvailableProperties: propertiesP
|
||||
inMemCtx: memCtx];
|
||||
|
@ -749,8 +749,8 @@ static Class NSDataK, NSStringK;
|
|||
}
|
||||
|
||||
/* proof of concept */
|
||||
- (int) setColumns: (enum MAPITAGS *) newColumns
|
||||
withCount: (uint16_t) newColumnsCount
|
||||
- (enum mapistore_error) setColumns: (enum MAPITAGS *) newColumns
|
||||
withCount: (uint16_t) newColumnsCount
|
||||
{
|
||||
NSUInteger count;
|
||||
|
||||
|
@ -831,15 +831,15 @@ static Class NSDataK, NSStringK;
|
|||
return nil;
|
||||
}
|
||||
|
||||
- (int) getRow: (struct mapistore_property_data **) dataP
|
||||
withRowID: (uint32_t) rowId
|
||||
andQueryType: (enum mapistore_query_type) queryType
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getRow: (struct mapistore_property_data **) dataP
|
||||
withRowID: (uint32_t) rowId
|
||||
andQueryType: (enum mapistore_query_type) queryType
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSUInteger count;
|
||||
MAPIStoreObject *child;
|
||||
struct mapistore_property_data *rowData;
|
||||
int rc;
|
||||
enum mapistore_error rc;
|
||||
|
||||
child = [self childAtRowID: rowId forQueryType: queryType];
|
||||
if (child)
|
||||
|
@ -858,8 +858,8 @@ static Class NSDataK, NSStringK;
|
|||
return rc;
|
||||
}
|
||||
|
||||
- (int) getRowCount: (uint32_t *) countP
|
||||
withQueryType: (enum mapistore_query_type) queryType
|
||||
- (enum mapistore_error) getRowCount: (uint32_t *) countP
|
||||
withQueryType: (enum mapistore_query_type) queryType
|
||||
{
|
||||
NSArray *children;
|
||||
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
#ifndef MAPISTORETASKSFOLDER_H
|
||||
#define MAPISTORETASKSFOLDER_H
|
||||
|
||||
#import "MAPIStoreGCSFolder.h"
|
||||
#import "MAPIStoreCalTaskFolder.h"
|
||||
|
||||
@interface MAPIStoreTasksFolder : MAPIStoreGCSFolder
|
||||
@interface MAPIStoreTasksFolder : MAPIStoreCalTaskFolder
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -75,6 +75,10 @@
|
|||
return newMessage;
|
||||
}
|
||||
|
||||
// --------------------------------------------
|
||||
// Permissions and sharing
|
||||
// --------------------------------------------
|
||||
|
||||
- (NSArray *) rolesForExchangeRights: (uint32_t) rights
|
||||
{
|
||||
NSMutableArray *roles;
|
||||
|
@ -82,21 +86,34 @@
|
|||
roles = [NSMutableArray arrayWithCapacity: 6];
|
||||
if (rights & RightsCreateItems)
|
||||
[roles addObject: SOGoRole_ObjectCreator];
|
||||
|
||||
if (rights & RightsDeleteAll)
|
||||
[roles addObject: SOGoRole_ObjectEraser];
|
||||
if (rights & RightsDeleteOwn)
|
||||
[roles addObject: MAPIStoreRightDeleteOwn];
|
||||
|
||||
if (rights & RightsEditAll)
|
||||
{
|
||||
[roles addObject: SOGoCalendarRole_PublicModifier];
|
||||
[roles addObject: SOGoCalendarRole_PrivateModifier];
|
||||
[roles addObject: SOGoCalendarRole_ConfidentialModifier];
|
||||
}
|
||||
else if (rights & RightsReadItems)
|
||||
if (rights & RightsEditOwn)
|
||||
[roles addObject: MAPIStoreRightEditOwn];
|
||||
|
||||
if (rights & RightsReadItems)
|
||||
{
|
||||
[roles addObject: SOGoCalendarRole_PublicViewer];
|
||||
[roles addObject: SOGoCalendarRole_PrivateViewer];
|
||||
[roles addObject: SOGoCalendarRole_ConfidentialViewer];
|
||||
}
|
||||
|
||||
if (rights & RightsFolderOwner)
|
||||
[roles addObject: MAPIStoreRightFolderOwner];
|
||||
|
||||
if (rights & RightsFolderContact)
|
||||
[roles addObject: MAPIStoreRightFolderContact];
|
||||
|
||||
return roles;
|
||||
}
|
||||
|
||||
|
@ -116,20 +133,65 @@
|
|||
&& [roles containsObject: SOGoCalendarRole_PrivateViewer]
|
||||
&& [roles containsObject: SOGoCalendarRole_ConfidentialViewer])
|
||||
rights |= RightsReadItems;
|
||||
|
||||
if ([roles containsObject: MAPIStoreRightEditOwn])
|
||||
rights |= RightsEditOwn;
|
||||
if ([roles containsObject: MAPIStoreRightDeleteOwn])
|
||||
rights |= RightsDeleteOwn;
|
||||
|
||||
if (rights != 0)
|
||||
rights |= RoleNone; /* actually "folder visible" */
|
||||
|
||||
if ([roles containsObject: MAPIStoreRightFolderOwner])
|
||||
rights |= RightsFolderOwner | RoleNone;
|
||||
|
||||
if ([roles containsObject: MAPIStoreRightFolderContact])
|
||||
rights |= RightsFolderContact;
|
||||
|
||||
return rights;
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanModifyMessages
|
||||
{
|
||||
static NSArray *modifierRoles = nil;
|
||||
|
||||
if (!modifierRoles)
|
||||
modifierRoles = [[NSArray alloc] initWithObjects:
|
||||
SOGoCalendarRole_PublicModifier,
|
||||
SOGoCalendarRole_PrivateModifier,
|
||||
SOGoCalendarRole_ConfidentialModifier,
|
||||
nil];
|
||||
|
||||
return ([[self activeUserRoles] firstObjectCommonWithArray: modifierRoles]
|
||||
!= nil);
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanReadMessages
|
||||
{
|
||||
static NSArray *viewerRoles = nil;
|
||||
|
||||
if (!viewerRoles)
|
||||
viewerRoles = [[NSArray alloc] initWithObjects:
|
||||
SOGoCalendarRole_PublicViewer,
|
||||
SOGoCalendarRole_PrivateViewer,
|
||||
SOGoCalendarRole_ConfidentialViewer,
|
||||
nil];
|
||||
|
||||
return ([[self activeUserRoles] firstObjectCommonWithArray: viewerRoles]
|
||||
!= nil);
|
||||
}
|
||||
|
||||
- (EOQualifier *) aclQualifier
|
||||
{
|
||||
return [EOQualifier qualifierWithQualifierFormat:
|
||||
[(SOGoAppointmentFolder *) sogoObject aclSQLListingFilter]];
|
||||
}
|
||||
|
||||
- (int) getPidTagDefaultPostMessageClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
// --------------------------------------------
|
||||
// Property getters
|
||||
// --------------------------------------------
|
||||
- (enum mapistore_error) getPidTagDefaultPostMessageClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [@"IPM.Task" asUnicodeInMemCtx: memCtx];
|
||||
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
#ifndef MAPISTORETASKSMESSAGE_H
|
||||
#define MAPISTORETASKSMESSAGE_H
|
||||
|
||||
#import "MAPIStoreGCSMessage.h"
|
||||
#import "MAPIStoreCalTaskMessage.h"
|
||||
|
||||
@interface MAPIStoreTasksMessage : MAPIStoreGCSMessage
|
||||
@interface MAPIStoreTasksMessage : MAPIStoreCalTaskMessage
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -68,8 +68,8 @@
|
|||
|
||||
@implementation MAPIStoreTasksMessage
|
||||
|
||||
- (int) getPidTagIconIndex: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagIconIndex: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
/* see http://msdn.microsoft.com/en-us/library/cc815472.aspx */
|
||||
// Unassigned recurring task 0x00000501
|
||||
|
@ -83,16 +83,16 @@
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagMessageClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagMessageClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = talloc_strdup(memCtx, "IPM.Task");
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagNormalizedSubject: (void **) data // SUMMARY
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagNormalizedSubject: (void **) data // SUMMARY
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
iCalToDo *task;
|
||||
|
||||
|
@ -103,10 +103,10 @@
|
|||
}
|
||||
|
||||
/* FIXME: Should be combined somehow with the code in MAPIStoreAppointmentWrapper.m */
|
||||
- (int) getPidTagBody: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagBody: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
int rc = MAPISTORE_SUCCESS;
|
||||
enum mapistore_error rc = MAPISTORE_SUCCESS;
|
||||
NSString *stringValue;
|
||||
iCalToDo *task;
|
||||
|
||||
|
@ -122,21 +122,32 @@
|
|||
}
|
||||
|
||||
/* FIXME: Should be combined somehow with the code in MAPIStoreAppointmentWrapper.m */
|
||||
- (int) getPidLidPrivate: (void **) data // private (bool), should depend on CLASS and permissions
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidPrivate: (void **) data // private (bool), should depend on CLASS and permissions
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
iCalToDo *task;
|
||||
|
||||
task = [sogoObject component: NO secure: YES];
|
||||
|
||||
if ([task symbolicAccessClass] == iCalAccessPublic)
|
||||
if ([task isPublic])
|
||||
return [self getNo: data inMemCtx: memCtx];
|
||||
|
||||
return [self getYes: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagImportance: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagSensitivity: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
uint32_t v;
|
||||
|
||||
v = (uint32_t) [self sensitivity];
|
||||
|
||||
*data = MAPILongValue (memCtx, v);
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (enum mapistore_error) getPidTagImportance: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
uint32_t v;
|
||||
iCalToDo *task;
|
||||
|
@ -154,8 +165,11 @@
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidLidTaskComplete: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
//------------------------------------
|
||||
// Specific task related properties
|
||||
//------------------------------------
|
||||
- (enum mapistore_error) getPidLidTaskComplete: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
iCalToDo *task;
|
||||
|
||||
|
@ -166,8 +180,8 @@
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidLidPercentComplete: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidPercentComplete: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
double doubleValue;
|
||||
iCalToDo *task;
|
||||
|
@ -180,10 +194,10 @@
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidLidTaskDateCompleted: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidTaskDateCompleted: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
int rc = MAPISTORE_SUCCESS;
|
||||
enum mapistore_error rc = MAPISTORE_SUCCESS;
|
||||
NSCalendarDate *dateValue;
|
||||
iCalToDo *task;
|
||||
|
||||
|
@ -198,54 +212,54 @@
|
|||
return rc;
|
||||
}
|
||||
|
||||
- (int) getPidLidTaskState: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidTaskState: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, 0x1); // not assigned
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidLidTaskMode: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidTaskMode: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getLongZero: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidTaskFRecurring: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidTaskFRecurring: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getNo: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidTaskAccepted: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidTaskAccepted: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getNo: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidTaskActualEffort: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidTaskActualEffort: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getLongZero: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidTaskEstimatedEffort: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidTaskEstimatedEffort: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getLongZero: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagHasAttachments: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagHasAttachments: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getNo: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidTaskDueDate: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidTaskDueDate: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
int rc = MAPISTORE_SUCCESS;
|
||||
enum mapistore_error rc = MAPISTORE_SUCCESS;
|
||||
NSCalendarDate *dateValue;
|
||||
iCalToDo *task;
|
||||
|
||||
|
@ -259,10 +273,10 @@
|
|||
return rc;
|
||||
}
|
||||
|
||||
- (int) getPidLidTaskStartDate: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidTaskStartDate: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
int rc = MAPISTORE_SUCCESS;
|
||||
enum mapistore_error rc = MAPISTORE_SUCCESS;
|
||||
NSCalendarDate *dateValue;
|
||||
iCalToDo *task;
|
||||
|
||||
|
@ -277,26 +291,26 @@
|
|||
}
|
||||
|
||||
|
||||
- (int) getPidTagMessageDeliveryTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidTagMessageDeliveryTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPidTagLastModificationTime: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getClientSubmitTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getClientSubmitTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPidTagLastModificationTime: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getLocalCommitTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getLocalCommitTime: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getPidTagLastModificationTime: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (int) getPidLidTaskStatus: (void **) data // status
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidTaskStatus: (void **) data // status
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *status;
|
||||
uint32_t longValue;
|
||||
|
@ -318,11 +332,12 @@
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidLidTaskOwner: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidTaskOwner: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
NSString *owner;
|
||||
|
||||
/* FIXME: This is wrong when setting task's request */
|
||||
owner = [sogoObject ownerInContext: nil];
|
||||
|
||||
*data = [owner asUnicodeInMemCtx: memCtx];
|
||||
|
@ -330,31 +345,51 @@
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidLidTaskOwnership: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getPidLidTaskOwnership: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getLongZero: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanReadMessage
|
||||
// ----------------------------------
|
||||
// Sharing
|
||||
// ----------------------------------
|
||||
- (NSUInteger) sensitivity
|
||||
{
|
||||
return ([[self activeUserRoles]
|
||||
containsObject: SOGoCalendarRole_ComponentViewer]
|
||||
|| [self subscriberCanModifyMessage]);
|
||||
iCalToDo *task;
|
||||
NSUInteger v;
|
||||
|
||||
task = [sogoObject component: NO secure: YES];
|
||||
/* FIXME: Use OpenChange constants names */
|
||||
switch ([task symbolicAccessClass])
|
||||
{
|
||||
case iCalAccessPrivate:
|
||||
v = 0x2;
|
||||
break;
|
||||
case iCalAccessConfidential:
|
||||
v = 0x3;
|
||||
break;
|
||||
default:
|
||||
v = 0x0;
|
||||
break;
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanModifyMessage
|
||||
- (NSString *) creator
|
||||
{
|
||||
BOOL rc;
|
||||
NSArray *roles = [self activeUserRoles];
|
||||
iCalToDo *task;
|
||||
|
||||
if (isNew)
|
||||
rc = [roles containsObject: SOGoRole_ObjectCreator];
|
||||
else
|
||||
rc = ([roles containsObject: SOGoCalendarRole_ComponentModifier]
|
||||
|| [roles containsObject: SOGoCalendarRole_ComponentResponder]);
|
||||
task = [sogoObject component: NO secure: YES];
|
||||
return [[task uniqueChildWithTag: @"x-sogo-component-created-by"]
|
||||
flattenedValuesForKey: @""];
|
||||
}
|
||||
|
||||
return rc;
|
||||
- (NSString *) owner
|
||||
{
|
||||
/* This is not true but to allow a user edit its own tasks is required.
|
||||
FIXME: When PidLidTaskOwner getter is properly implemented for Task Requests */
|
||||
return [self creator];
|
||||
}
|
||||
|
||||
- (void) save:(TALLOC_CTX *) memCtx
|
||||
|
@ -524,10 +559,16 @@
|
|||
[vToDo setAccessClass: @"PUBLIC"];
|
||||
}
|
||||
|
||||
/* Creation */
|
||||
now = [NSCalendarDate date];
|
||||
if ([sogoObject isNew])
|
||||
{
|
||||
[vToDo setCreated: now];
|
||||
/* Creator is used for sharing purposes */
|
||||
value = [properties objectForKey: MAPIPropertyKey (PidTagLastModifierName)];
|
||||
if (value)
|
||||
[[vToDo uniqueChildWithTag: @"x-sogo-component-created-by"] setSingleValue: value
|
||||
forKey: @""];
|
||||
}
|
||||
[vToDo setTimeStampAsDate: now];
|
||||
|
||||
|
|
|
@ -41,16 +41,16 @@ struct MAPIStoreTallocWrapper
|
|||
|
||||
@interface NSObject (MAPIStoreDataTypes)
|
||||
|
||||
- (int) getValue: (void **) data
|
||||
forTag: (enum MAPITAGS) propTag
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getValue: (void **) data
|
||||
forTag: (enum MAPITAGS) propTag
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
|
||||
/* getter helpers */
|
||||
- (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) getSMTPAddrType: (void **) data inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getEmptyString: (void **) data inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getLongZero: (void **) data inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getYes: (void **) data inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getNo: (void **) data inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (enum mapistore_error) getSMTPAddrType: (void **) data inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -74,12 +74,12 @@ MAPIStoreTallocWrapperDestroy (void *data)
|
|||
|
||||
@implementation NSObject (MAPIStoreDataTypes)
|
||||
|
||||
- (int) getValue: (void **) data
|
||||
forTag: (enum MAPITAGS) propTag
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getValue: (void **) data
|
||||
forTag: (enum MAPITAGS) propTag
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
uint16_t valueType;
|
||||
int rc = MAPISTORE_SUCCESS;
|
||||
enum mapistore_error rc = MAPISTORE_SUCCESS;
|
||||
|
||||
// [self logWithFormat: @"property %.8x found", propTag];
|
||||
valueType = (propTag & 0xffff);
|
||||
|
@ -139,35 +139,35 @@ MAPIStoreTallocWrapperDestroy (void *data)
|
|||
}
|
||||
|
||||
/* helper getters */
|
||||
- (int) getEmptyString: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getEmptyString: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [@"" asUnicodeInMemCtx: memCtx];
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getLongZero: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getLongZero: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, 0);
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getYes: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getYes: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPIBoolValue (memCtx, YES);
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getNo: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getNo: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPIBoolValue (memCtx, NO);
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getSMTPAddrType: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
|
||||
- (enum mapistore_error) getSMTPAddrType: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = [@"SMTP" asUnicodeInMemCtx: memCtx];
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
#define DEFAULT_CHARSET 1
|
||||
#define FONTNAME_LEN_MAX 100
|
||||
#define UTF8_FIRST_BYTE_LAST_CODEPOINT 0x7F
|
||||
|
||||
//
|
||||
// Charset definitions. See http://msdn.microsoft.com/en-us/goglobal/bb964654 for all details.
|
||||
//
|
||||
|
@ -608,7 +608,6 @@ static void _init_fontCws_table()
|
|||
word and is not part of the control word. */
|
||||
|
||||
end = _bytes;
|
||||
|
||||
*len = end-start-1;
|
||||
|
||||
return start+1;
|
||||
|
@ -1215,7 +1214,6 @@ inline static void parseUl(RTFHandler *self, BOOL hasArg, int arg, RTFFormatting
|
|||
unsigned char c;
|
||||
NSData *d;
|
||||
NSString *s;
|
||||
unichar uch;
|
||||
|
||||
stack = [[RTFStack alloc] init];
|
||||
fontTable = nil;
|
||||
|
@ -1223,7 +1221,7 @@ inline static void parseUl(RTFHandler *self, BOOL hasArg, int arg, RTFFormatting
|
|||
defaultCharset = ansicpg1252;
|
||||
formattingOptions = nil;
|
||||
|
||||
_html = [[NSMutableData alloc] init];
|
||||
_html = [[[NSMutableData alloc] init] autorelease];
|
||||
[_html appendBytes: "<html><meta charset='utf-8'><body>" length: 34];
|
||||
|
||||
|
||||
|
@ -1251,10 +1249,10 @@ inline static void parseUl(RTFHandler *self, BOOL hasArg, int arg, RTFFormatting
|
|||
{
|
||||
// A hexadecimal value, based on the specified character set (may be used to identify 8-bit values).
|
||||
const char *b1, *b2;
|
||||
unsigned short index;
|
||||
short index;
|
||||
short tmp;
|
||||
|
||||
const unsigned short * active_charset;
|
||||
|
||||
if (formattingOptions && formattingOptions->charset)
|
||||
active_charset = formattingOptions->charset;
|
||||
else
|
||||
|
@ -1267,8 +1265,21 @@ inline static void parseUl(RTFHandler *self, BOOL hasArg, int arg, RTFFormatting
|
|||
b1 = ADVANCE;
|
||||
b2 = ADVANCE;
|
||||
|
||||
index = (isdigit(*b1) ? *b1 - 48 : toupper(*b1) - 55) * 16;
|
||||
index += (isdigit(*b2) ? *b2 - 48 : toupper(*b2) - 55);
|
||||
tmp = (isdigit(*b1) ? *b1 - 48 : toupper(*b1) - 55);
|
||||
if (tmp < 0 || tmp > 16)
|
||||
{
|
||||
// Incorrect first hexadecimal character. Skipping.
|
||||
continue;
|
||||
}
|
||||
index = tmp*16;
|
||||
|
||||
tmp = (isdigit(*b2) ? *b2 - 48 : toupper(*b2) - 55);
|
||||
if (tmp < 0 || tmp > 16)
|
||||
{
|
||||
// Incorrect second hexadecimal character. Skipping.
|
||||
continue;
|
||||
}
|
||||
index += tmp;
|
||||
|
||||
s = [NSString stringWithCharacters: &(active_charset[index]) length: 1];
|
||||
d = [s dataUsingEncoding: NSUTF8StringEncoding];
|
||||
|
@ -1437,20 +1448,17 @@ inline static void parseUl(RTFHandler *self, BOOL hasArg, int arg, RTFFormatting
|
|||
{
|
||||
c = *_bytes;
|
||||
// We avoid appending NULL bytes or endlines
|
||||
if (c && (c != '\n'))
|
||||
if (c && (c != '\n') && (c != '\r'))
|
||||
{
|
||||
if (c <= UTF8_FIRST_BYTE_LAST_CODEPOINT)
|
||||
{
|
||||
// in this case utf8 and ascii encoding are the same
|
||||
[_html appendBytes: &c length: 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
uch = c;
|
||||
s = [NSString stringWithCharacters: &uch length: 1];
|
||||
d = [s dataUsingEncoding: NSUTF8StringEncoding];
|
||||
[_html appendData: d];
|
||||
}
|
||||
const unsigned short * active_charset;
|
||||
if (formattingOptions && formattingOptions->charset)
|
||||
active_charset = formattingOptions->charset;
|
||||
else
|
||||
active_charset = defaultCharset;
|
||||
|
||||
s = [NSString stringWithCharacters: &(active_charset[c]) length: 1];
|
||||
d = [s dataUsingEncoding: NSUTF8StringEncoding];
|
||||
[_html appendData: d];
|
||||
}
|
||||
ADVANCE;
|
||||
}
|
||||
|
@ -1459,7 +1467,7 @@ inline static void parseUl(RTFHandler *self, BOOL hasArg, int arg, RTFFormatting
|
|||
[_html appendBytes: "</body></html>" length: 14];
|
||||
|
||||
[stack release];
|
||||
return [_html autorelease];
|
||||
return _html;
|
||||
}
|
||||
|
||||
/* This method is for ease of testing and should not be used in normal operations */
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
typedef int (*MAPIStorePropertyGetter) (id inst, SEL _cmd,
|
||||
void **data, TALLOC_CTX *memCtx);
|
||||
typedef enum mapistore_error (*MAPIStorePropertyGetter) (id inst, SEL _cmd,
|
||||
void **data, TALLOC_CTX *memCtx);
|
||||
|
||||
const MAPIStorePropertyGetter *MAPIStorePropertyGettersForClass (Class klass);
|
||||
SEL MAPIStoreSelectorForPropertyGetter (uint16_t propertyId);
|
||||
|
|
|
@ -235,7 +235,7 @@ if __name__ == "__main__":
|
|||
highest_prop_idx = prop_idx
|
||||
getters.append(" @selector (get%s:inMemCtx:)" % name)
|
||||
# preferred_types.append(" 0x%.4x" % (prop_tag & 0xffff))
|
||||
prototypes.append("- (int) get%s: (void **) data inMemCtx: (TALLOC_CTX *) memCtx;" % name)
|
||||
prototypes.append("- (enum mapistore_error) 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)
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
- (void) updateFromMAPIProperties: (NSDictionary *) properties
|
||||
inUserContext: (MAPIStoreUserContext *) userContext
|
||||
withActiveUser: (SOGoUser *) activeUser
|
||||
isNew: (BOOL) isNew
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
@end
|
||||
|
||||
|
|
|
@ -247,6 +247,7 @@
|
|||
- (void) updateFromMAPIProperties: (NSDictionary *) properties
|
||||
inUserContext: (MAPIStoreUserContext *) userContext
|
||||
withActiveUser: (SOGoUser *) activeUser
|
||||
isNew: (BOOL) isNew
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
BOOL isAllDay;
|
||||
|
@ -573,6 +574,14 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
// Creator (with sharing purposes)
|
||||
if (isNew)
|
||||
{
|
||||
value = [properties objectForKey: MAPIPropertyKey (PidTagLastModifierName)];
|
||||
if (value)
|
||||
[[self uniqueChildWithTag: @"x-sogo-component-created-by"] setSingleValue: value
|
||||
forKey: @""];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -3387,12 +3387,60 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
|
|||
}
|
||||
|
||||
/* acls */
|
||||
|
||||
/* Compare two permissions to set first the highest access right, if unknown, then
|
||||
do nothing */
|
||||
static NSComparisonResult _comparePermissions (id perm1, id perm2, void *context)
|
||||
{
|
||||
static NSDictionary *permMap = nil;
|
||||
NSNumber *num_1, *num_2;
|
||||
|
||||
if (!permMap)
|
||||
{
|
||||
NSMutableArray *numberObjs;
|
||||
NSUInteger i, max = 16;
|
||||
|
||||
numberObjs = [NSMutableArray arrayWithCapacity: max];
|
||||
for (i = 0; i < max; i++)
|
||||
[numberObjs addObject: [NSNumber numberWithInteger: i]];
|
||||
|
||||
/* Build the map to compare easily */
|
||||
permMap = [[NSDictionary alloc] initWithObjects: numberObjs
|
||||
forKeys: [NSArray arrayWithObjects:
|
||||
SOGoRole_ObjectEraser,
|
||||
SOGoRole_ObjectCreator,
|
||||
SOGoRole_ObjectEditor,
|
||||
SOGoCalendarRole_ConfidentialModifier,
|
||||
SOGoCalendarRole_ConfidentialResponder,
|
||||
SOGoCalendarRole_ConfidentialViewer,
|
||||
SOGoCalendarRole_ConfidentialDAndTViewer,
|
||||
SOGoCalendarRole_PrivateModifier,
|
||||
SOGoCalendarRole_PrivateResponder,
|
||||
SOGoCalendarRole_PrivateViewer,
|
||||
SOGoCalendarRole_PrivateDAndTViewer,
|
||||
SOGoCalendarRole_PublicModifier,
|
||||
SOGoCalendarRole_PublicResponder,
|
||||
SOGoCalendarRole_PublicViewer,
|
||||
SOGoCalendarRole_PublicDAndTViewer,
|
||||
SOGoCalendarRole_FreeBusyReader, nil]];
|
||||
[permMap retain];
|
||||
}
|
||||
|
||||
num_1 = [permMap objectForKey: perm1];
|
||||
if (!num_1)
|
||||
num_1 = [NSNumber numberWithInteger: 255];
|
||||
num_2 = [permMap objectForKey: perm2];
|
||||
if (!num_2)
|
||||
num_2 = [NSNumber numberWithInteger: 255];
|
||||
|
||||
return [num_1 compare: num_2];
|
||||
}
|
||||
|
||||
- (NSArray *) aclsForUser: (NSString *) uid
|
||||
forObjectAtPath: (NSArray *) objectPathArray
|
||||
{
|
||||
NSMutableArray *aclsForUser;
|
||||
NSArray *superAcls;
|
||||
static NSArray *rolesClassifications = nil;
|
||||
|
||||
superAcls = [super aclsForUser: uid forObjectAtPath: objectPathArray];
|
||||
if ([uid isEqualToString: [self defaultUserID]])
|
||||
|
@ -3408,44 +3456,12 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
|
|||
}
|
||||
else
|
||||
{
|
||||
aclsForUser = [NSMutableArray array];
|
||||
if (!rolesClassifications)
|
||||
{
|
||||
rolesClassifications =
|
||||
[NSArray arrayWithObjects:
|
||||
[NSArray arrayWithObjects:
|
||||
SOGoCalendarRole_PublicModifier,
|
||||
SOGoCalendarRole_PublicResponder,
|
||||
SOGoCalendarRole_PublicViewer,
|
||||
SOGoCalendarRole_PublicDAndTViewer,
|
||||
nil],
|
||||
[NSArray arrayWithObjects:
|
||||
SOGoCalendarRole_ConfidentialModifier,
|
||||
SOGoCalendarRole_ConfidentialResponder,
|
||||
SOGoCalendarRole_ConfidentialViewer,
|
||||
SOGoCalendarRole_ConfidentialDAndTViewer,
|
||||
nil],
|
||||
[NSArray arrayWithObjects:
|
||||
SOGoCalendarRole_PrivateModifier,
|
||||
SOGoCalendarRole_PrivateResponder,
|
||||
SOGoCalendarRole_PrivateViewer,
|
||||
SOGoCalendarRole_PrivateDAndTViewer,
|
||||
nil],
|
||||
[NSArray arrayWithObject: SOGoRole_ObjectCreator],
|
||||
[NSArray arrayWithObject: SOGoRole_ObjectEraser],
|
||||
nil];
|
||||
[rolesClassifications retain];
|
||||
}
|
||||
// When a user is a member of many groups for which there are access rights, multiple access rights
|
||||
// can be returned for each classification. In this case, we only keep the highest access right.
|
||||
int i, count = [rolesClassifications count];
|
||||
NSString *role;
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
role = [[rolesClassifications objectAtIndex: i] firstObjectCommonWithArray: superAcls];
|
||||
if (role)
|
||||
[aclsForUser addObject: role];
|
||||
}
|
||||
/* Sort setting the highest access right first, so in the case
|
||||
of a user member of several groups, the highest access right
|
||||
is checked first, for instance, in
|
||||
[SOGoAppointmentFolder:roleForComponentsWithAccessClass:forUser] */
|
||||
aclsForUser = (NSMutableArray *) [superAcls sortedArrayUsingFunction: _comparePermissions
|
||||
context: NULL];
|
||||
}
|
||||
|
||||
return aclsForUser;
|
||||
|
|
|
@ -47,10 +47,13 @@
|
|||
{
|
||||
NSURL *imap4URL;
|
||||
NGImap4Connection *imap4;
|
||||
BOOL imap4ExceptionsEnabled;
|
||||
}
|
||||
|
||||
- (BOOL) isFolderish;
|
||||
|
||||
- (id) init;
|
||||
|
||||
- (id) initWithImap4URL: (NSURL *) _url
|
||||
inContainer: (id) _container;
|
||||
|
||||
|
|
|
@ -40,11 +40,25 @@
|
|||
|
||||
@implementation SOGoMailBaseObject
|
||||
|
||||
|
||||
- (id)init
|
||||
{
|
||||
if ((self = [super init]))
|
||||
{
|
||||
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
|
||||
// With this to YES, imap4Connection will raise exception if a working
|
||||
// connection cannot be provided
|
||||
imap4ExceptionsEnabled = [ud boolForKey:@"SoIMAP4ExceptionsEnabled"];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id) initWithImap4URL: (NSURL *) _url
|
||||
inContainer: (id) _container
|
||||
{
|
||||
NSString *n;
|
||||
|
||||
|
||||
n = [[_url path] lastPathComponent];
|
||||
if ((self = [self initWithName: n inContainer:_container]))
|
||||
{
|
||||
|
@ -143,7 +157,10 @@
|
|||
if (!newConnection)
|
||||
{
|
||||
newConnection = (NGImap4Connection *) [NSNull null];
|
||||
[self errorWithFormat:@"Could not connect IMAP4"];
|
||||
if (imap4ExceptionsEnabled)
|
||||
[NSException raise: @"IOException" format: @"IMAP connection failed"];
|
||||
else
|
||||
[self errorWithFormat:@"Could not connect IMAP4"];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -201,6 +218,22 @@
|
|||
[imap4 retain];
|
||||
}
|
||||
|
||||
// Connection broken, try to reconnect
|
||||
if (![imap4 isKindOfClass: [NSNull class]] && ![[[imap4 client] isConnected] boolValue])
|
||||
{
|
||||
[self warnWithFormat: @"IMAP connection is broken, trying to reconnect..."];
|
||||
[[imap4 client] reconnect];
|
||||
|
||||
// Still broken, give up
|
||||
if (![[[imap4 client] isConnected] boolValue])
|
||||
{
|
||||
if (imap4ExceptionsEnabled)
|
||||
[NSException raise: @"IOException" format: @"IMAP connection failed"];
|
||||
else
|
||||
[self errorWithFormat: @"Could not get a valid IMAP connection"];
|
||||
}
|
||||
}
|
||||
|
||||
return [imap4 isKindOfClass: [NSNull class]] ? nil : imap4;
|
||||
}
|
||||
|
||||
|
|
|
@ -129,9 +129,9 @@ NSArray *SOGoMailCoreInfoKeys;
|
|||
inContext: (id)_ctx;
|
||||
|
||||
- (void) addRequiredKeysOfStructure: (NSDictionary *) info
|
||||
path: (NSString *) p
|
||||
toArray: (NSMutableArray *) keys
|
||||
acceptedTypes: (NSArray *) types
|
||||
path: (NSString *) p
|
||||
toArray: (NSMutableArray *) keys
|
||||
acceptedTypes: (NSArray *) types
|
||||
withPeek: (BOOL) withPeek;
|
||||
|
||||
@end
|
||||
|
|
|
@ -507,12 +507,15 @@ static BOOL debugSoParts = NO;
|
|||
return s;
|
||||
}
|
||||
|
||||
/* This is defined before the public version without parentMimeType
|
||||
argument to be able to call it recursively */
|
||||
/* bulk fetching of plain/text content */
|
||||
- (void) addRequiredKeysOfStructure: (NSDictionary *) info
|
||||
path: (NSString *) p
|
||||
toArray: (NSMutableArray *) keys
|
||||
acceptedTypes: (NSArray *) types
|
||||
path: (NSString *) p
|
||||
toArray: (NSMutableArray *) keys
|
||||
acceptedTypes: (NSArray *) types
|
||||
withPeek: (BOOL) withPeek
|
||||
parentMultipart: (NSString *) parentMPart
|
||||
{
|
||||
/*
|
||||
This is used to collect the set of IMAP4 fetch-keys required to fetch
|
||||
|
@ -527,6 +530,7 @@ static BOOL debugSoParts = NO;
|
|||
id body;
|
||||
NSString *bodyToken, *sp, *mimeType;
|
||||
id childInfo;
|
||||
NSString *multipart;
|
||||
|
||||
bodyToken = (withPeek ? @"body.peek" : @"body");
|
||||
|
||||
|
@ -534,6 +538,12 @@ static BOOL debugSoParts = NO;
|
|||
[info valueForKey: @"type"],
|
||||
[info valueForKey: @"subtype"]]
|
||||
lowercaseString];
|
||||
|
||||
if ([[info valueForKey: @"type"] isEqualToString: @"multipart"])
|
||||
multipart = mimeType;
|
||||
else
|
||||
multipart = parentMPart;
|
||||
|
||||
if ([types containsObject: mimeType])
|
||||
{
|
||||
if ([p length] > 0)
|
||||
|
@ -548,7 +558,8 @@ static BOOL debugSoParts = NO;
|
|||
k = [NSString stringWithFormat: @"%@[text]", bodyToken];
|
||||
}
|
||||
[keys addObject: [NSDictionary dictionaryWithObjectsAndKeys: k, @"key",
|
||||
mimeType, @"mimeType", nil]];
|
||||
mimeType, @"mimeType",
|
||||
multipart, @"multipart", nil]];
|
||||
}
|
||||
|
||||
parts = [info objectForKey: @"parts"];
|
||||
|
@ -562,9 +573,11 @@ static BOOL debugSoParts = NO;
|
|||
childInfo = [parts objectAtIndex: i];
|
||||
|
||||
[self addRequiredKeysOfStructure: childInfo
|
||||
path: sp toArray: keys
|
||||
acceptedTypes: types
|
||||
withPeek: withPeek];
|
||||
path: sp
|
||||
toArray: keys
|
||||
acceptedTypes: types
|
||||
withPeek: withPeek
|
||||
parentMultipart: multipart];
|
||||
}
|
||||
|
||||
/* check body */
|
||||
|
@ -588,12 +601,28 @@ static BOOL debugSoParts = NO;
|
|||
else
|
||||
sp = [p length] > 0 ? (id)[p stringByAppendingString: @".1"] : (id)@"1";
|
||||
[self addRequiredKeysOfStructure: body
|
||||
path: sp toArray: keys
|
||||
acceptedTypes: types
|
||||
withPeek: withPeek];
|
||||
path: sp
|
||||
toArray: keys
|
||||
acceptedTypes: types
|
||||
withPeek: withPeek
|
||||
parentMultipart: multipart];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) addRequiredKeysOfStructure: (NSDictionary *) info
|
||||
path: (NSString *) p
|
||||
toArray: (NSMutableArray *) keys
|
||||
acceptedTypes: (NSArray *) types
|
||||
withPeek: (BOOL) withPeek
|
||||
{
|
||||
[self addRequiredKeysOfStructure: (NSDictionary *) info
|
||||
path: (NSString *) p
|
||||
toArray: (NSMutableArray *) keys
|
||||
acceptedTypes: (NSArray *) types
|
||||
withPeek: (BOOL) withPeek
|
||||
parentMultipart: @""];
|
||||
}
|
||||
|
||||
- (NSArray *) plainTextContentFetchKeys
|
||||
{
|
||||
/*
|
||||
|
|
|
@ -57,6 +57,7 @@
|
|||
|
||||
#include "SOGoCache.h"
|
||||
#include "SOGoSource.h"
|
||||
#include "SOGoSystemDefaults.h"
|
||||
#include "SOGoUserManager.h"
|
||||
#include "SOGoUser.h"
|
||||
|
||||
|
@ -102,13 +103,29 @@
|
|||
+ (id) groupWithIdentifier: (NSString *) theID
|
||||
inDomain: (NSString *) domain
|
||||
{
|
||||
NSString *uid;
|
||||
NSRange r;
|
||||
NSString *uid, *inDomain;
|
||||
SOGoSystemDefaults *sd;
|
||||
|
||||
uid = [theID hasPrefix: @"@"] ? [theID substringFromIndex: 1] : theID;
|
||||
inDomain = domain;
|
||||
|
||||
sd = [SOGoSystemDefaults sharedSystemDefaults];
|
||||
if ([sd enableDomainBasedUID])
|
||||
{
|
||||
/* Split domain from uid */
|
||||
r = [uid rangeOfString: @"@" options: NSBackwardsSearch];
|
||||
if (r.location != NSNotFound)
|
||||
{
|
||||
if (!domain)
|
||||
inDomain = [uid substringFromIndex: r.location + 1];
|
||||
uid = [uid substringToIndex: r.location];
|
||||
}
|
||||
}
|
||||
|
||||
return [SOGoGroup groupWithValue: uid
|
||||
andSourceSelector: @selector (lookupGroupEntryByUID:inDomain:)
|
||||
inDomain: domain];
|
||||
inDomain: inDomain];
|
||||
}
|
||||
|
||||
+ (id) groupWithEmail: (NSString *) theEmail
|
||||
|
|
|
@ -24,6 +24,7 @@ $(TEST_TOOL)_OBJC_FILES += \
|
|||
TestNGMimeAddressHeaderFieldGenerator.m \
|
||||
TestNGMimeHeaderFieldGenerator.m \
|
||||
TestNGMimeMessageGenerator.m \
|
||||
TestNGMimeType.m \
|
||||
\
|
||||
TestNSData+Crypto.m \
|
||||
TestNSString+Crypto.m \
|
||||
|
|
|
@ -83,6 +83,15 @@
|
|||
@" =?utf-8?q?=D1=8C=D1=8C=D1=8C=D1=8C=D1=8C=D1=8C=D1=8C=D1=8C=D1=8C=D1=8C=D1=8C?=\n"
|
||||
@" =?utf-8?q?=D1=8C=D1=8C=D1=8C=D1=8C=D1=8C=D1=8C=D1=8C=D1=8C=D1=8C=D1=8C=D1=8C?=\n"
|
||||
@" =?utf-8?q?=D1=8C=D1=8C=D1=8C?=", nil],
|
||||
[NSArray arrayWithObjects:
|
||||
@"aжжжжжжжжжжж",
|
||||
@"=?utf-8?q?a=D0=B6=D0=B6=D0=B6=D0=B6=D0=B6=D0=B6=D0=B6=D0=B6=D0=B6?=\n"
|
||||
@" =?utf-8?q?=D0=B6=D0=B6?=", nil],
|
||||
[NSArray arrayWithObjects:
|
||||
@"aжжжжжжжжжжжжжжжжжжжжж",
|
||||
@"=?utf-8?q?a=D0=B6=D0=B6=D0=B6=D0=B6=D0=B6=D0=B6=D0=B6=D0=B6=D0=B6?=\n"
|
||||
@" =?utf-8?q?=D0=B6=D0=B6=D0=B6=D0=B6=D0=B6=D0=B6=D0=B6=D0=B6=D0=B6=D0=B6=D0=B6?=\n"
|
||||
@" =?utf-8?q?=D0=B6?=", nil],
|
||||
nil
|
||||
];
|
||||
NSArray *caseData;
|
||||
|
|
|
@ -43,26 +43,18 @@
|
|||
return nil;
|
||||
|
||||
RTFHandler *handler = [[RTFHandler alloc] initWithData: rtf];
|
||||
NSMutableData *data2 = [handler parse];
|
||||
if (data2 == nil)
|
||||
NSMutableData *data = [handler parse];
|
||||
if (data == nil)
|
||||
{
|
||||
NSString *error = [NSString stringWithFormat: @"Couldn't parse RTF data:\n %s",
|
||||
(char *)[rtf bytes]];
|
||||
testWithMessage(NO, error);
|
||||
}
|
||||
|
||||
html = [[NSString alloc] initWithData: data2 encoding: NSUTF8StringEncoding];
|
||||
html = [[NSString alloc] initWithData: data encoding: NSUTF8StringEncoding];
|
||||
if (html == nil)
|
||||
{
|
||||
html = [[NSString alloc] initWithData: data2 encoding: NSASCIIStringEncoding];
|
||||
}
|
||||
if (html == nil)
|
||||
{
|
||||
html = [[NSString alloc] initWithData: data2 encoding: NSISOLatin1StringEncoding];
|
||||
}
|
||||
if (html == nil)
|
||||
{
|
||||
NSString *error = [NSString stringWithFormat: @"Couldn't convert parsed data"];
|
||||
NSString *error = [NSString stringWithFormat: @"Couldn't convert parsed data to UTF8 string"];
|
||||
testWithMessage(NO, error);
|
||||
}
|
||||
return html;
|
||||
|
@ -304,4 +296,22 @@
|
|||
againstExpectedHTML: expected];
|
||||
}
|
||||
|
||||
- (void) test_cyr_event_ru_editor
|
||||
{
|
||||
NSString *file =@"cyr_event_ru_editor.rtf";
|
||||
NSString *expected=@"<html><meta charset='utf-8'><body><font face=\"Calibri\"><font face=\"Calibri Cyr\"><font color=\"#000000\">йчсмй</font></font><font color=\"#000000\"><br></font></font></body></html>";
|
||||
|
||||
[self checkHTMLConversionOfRTFFile: file
|
||||
againstExpectedHTML: expected];
|
||||
}
|
||||
|
||||
- (void) test_bad_hex_and_cr
|
||||
{
|
||||
NSString *file =@"bad_hex_and_cr.rtf";
|
||||
NSString *expected=@"<html><meta charset='utf-8'><body><font face=\"Calibri\"><font face=\"Calibri Cyr\"><font color=\"#000000\">Good hex:H Bad1Hex: Bad2Hex: Ignored Carriadge Return</font></font></font></body></html>";
|
||||
|
||||
[self checkHTMLConversionOfRTFFile: file
|
||||
againstExpectedHTML: expected];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#import <Foundation/NSValue.h>
|
||||
|
||||
#import <SOGo/SOGoSystemDefaults.h>
|
||||
#import <SOGo/SOGoProductLoader.h>
|
||||
|
||||
#import "SOGoTool.h"
|
||||
|
||||
|
@ -242,6 +243,9 @@ main (int argc, char **argv, char **env)
|
|||
|
||||
pool = [NSAutoreleasePool new];
|
||||
|
||||
/* load products */
|
||||
[[SOGoProductLoader productLoader] loadAllProducts];
|
||||
|
||||
[SOGoSystemDefaults sharedSystemDefaults];
|
||||
setupUserDefaults ();
|
||||
|
||||
|
|
|
@ -51,25 +51,24 @@
|
|||
{
|
||||
NSEnumerator *roles, *types;
|
||||
NSString *role, *type;
|
||||
unsigned int length;
|
||||
|
||||
roles = [userRights objectEnumerator];
|
||||
role = [roles nextObject];
|
||||
while (role)
|
||||
types = [[self rightTypes] objectEnumerator];
|
||||
type = [types nextObject];
|
||||
while (type)
|
||||
{
|
||||
types = [[self rightTypes] objectEnumerator];
|
||||
type = [types nextObject];
|
||||
while (type)
|
||||
{
|
||||
if ([role hasPrefix: type])
|
||||
{
|
||||
length = [type length];
|
||||
[rights setObject: [role substringFromIndex: length]
|
||||
forKey: type];
|
||||
}
|
||||
type = [types nextObject];
|
||||
}
|
||||
roles = [userRights objectEnumerator];
|
||||
role = [roles nextObject];
|
||||
while (role)
|
||||
{
|
||||
if ([role hasPrefix: type])
|
||||
{
|
||||
[rights setObject: [role substringFromIndex: [type length]]
|
||||
forKey: type];
|
||||
break;
|
||||
}
|
||||
role = [roles nextObject];
|
||||
}
|
||||
type = [types nextObject];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue