Monotone-Parent: 35e905507b00aa93112b244da8c4f4c32c7942c7
Monotone-Revision: c4cd64ca35c43c187a23cc30e1bad4db1a5e9d1d Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-08-06T19:20:07 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
df6f1e3023
commit
28816877aa
|
@ -28,6 +28,7 @@
|
|||
#import "MAPIStoreMapping.h"
|
||||
#import "MAPIStoreMessage.h"
|
||||
#import "MAPIStoreTypes.h"
|
||||
#import "NSObject+MAPIStore.h"
|
||||
|
||||
#undef DEBUG
|
||||
#include <stdbool.h>
|
||||
|
@ -90,6 +91,12 @@
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) 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
|
||||
|
|
|
@ -20,14 +20,22 @@
|
|||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <Foundation/NSCalendarDate.h>
|
||||
#import <Foundation/NSData.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSTimeZone.h>
|
||||
|
||||
#import <NGObjWeb/WOContext+SoObjects.h>
|
||||
#import <NGExtensions/NSObject+Logs.h>
|
||||
|
||||
#import "iCalEvent+MAPIStore.h"
|
||||
#import "MAPIStoreTypes.h"
|
||||
#import "MAPIStoreCalendarEmbeddedMessage.h"
|
||||
#import "MAPIStoreTypes.h"
|
||||
#import "MAPIStoreUserContext.h"
|
||||
#import "NSDate+MAPIStore.h"
|
||||
#import "NSData+MAPIStore.h"
|
||||
#import "NSObject+MAPIStore.h"
|
||||
#import "NSString+MAPIStore.h"
|
||||
|
||||
#import "MAPIStoreCalendarAttachment.h"
|
||||
|
||||
|
@ -65,12 +73,16 @@
|
|||
return event;
|
||||
}
|
||||
|
||||
- (NSString *) nameInContainer
|
||||
{
|
||||
return [[event uniqueChildWithTag: @"recurrence-id"]
|
||||
flattenedValuesForKey: @""];
|
||||
}
|
||||
|
||||
- (int) getPidTagAttachmentHidden: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) localMemCtx
|
||||
{
|
||||
*data = MAPIBoolValue (localMemCtx, YES);
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
return [self getYes: data inMemCtx: localMemCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagAttachmentFlags: (void **) data
|
||||
|
@ -81,6 +93,18 @@
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagAttachmentLinkId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) localMemCtx
|
||||
{
|
||||
return [self getLongZero: data inMemCtx: localMemCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagAttachFlags: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) localMemCtx
|
||||
{
|
||||
return [self getLongZero: data inMemCtx: localMemCtx];
|
||||
}
|
||||
|
||||
- (int) getPidTagAttachMethod: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) localMemCtx
|
||||
{
|
||||
|
@ -89,8 +113,28 @@
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
// case PidTagExceptionStartTime:
|
||||
// case PidTagExceptionEndTime:
|
||||
- (int) getPidTagAttachEncoding: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) localMemCtx
|
||||
{
|
||||
*data = [[NSData data] asBinaryInMemCtx: localMemCtx];
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagDisplayName: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) localMemCtx
|
||||
{
|
||||
*data = "Untitled";
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagAttachmentContactPhoto: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getNo: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
// case PidTagExceptionReplaceTime:
|
||||
|
||||
/* subclasses */
|
||||
|
|
|
@ -98,6 +98,14 @@
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagMessageFlags: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = MAPILongValue (memCtx, MSGFLAG_UNMODIFIED);
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidTagProcessed: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getYes: data inMemCtx: memCtx];
|
||||
|
@ -109,6 +117,44 @@
|
|||
return [self getYes: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
/* discarded properties */
|
||||
|
||||
- (int) getPidLidAppointmentLastSequence: (void **)
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
- (int) getPidLidMeetingWorkspaceUrl: (void **)
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
- (int) getPidLidContacts: (void **)
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
- (int) getPidTagSensitivity: (void **)
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
- (int) getPidLidPrivate: (void **)
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
- (int) getPidNameKeywords: (void **)
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
- (void) save
|
||||
{
|
||||
// (gdb) po embeddedMessage->properties
|
||||
|
|
|
@ -122,6 +122,7 @@
|
|||
NSString *newKey;
|
||||
MAPIStoreCalendarAttachment *attachment;
|
||||
NSUInteger aid;
|
||||
iCalEvent *event;
|
||||
|
||||
events = [calendar events];
|
||||
max = [events count];
|
||||
|
@ -133,8 +134,10 @@
|
|||
right AID is 0 from the start */
|
||||
aid = count - 1;
|
||||
[attachment setAID: aid];
|
||||
[attachment setEvent: [events objectAtIndex: count]];
|
||||
newKey = [NSString stringWithFormat: @"%ul", aid];
|
||||
event = [events objectAtIndex: count];
|
||||
[attachment setEvent: event];
|
||||
newKey = [[event uniqueChildWithTag: @"recurrence-id"]
|
||||
flattenedValuesForKey: @""];
|
||||
[attachmentParts setObject: attachment forKey: newKey];
|
||||
}
|
||||
}
|
||||
|
@ -201,14 +204,6 @@
|
|||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidLidAppointmentMessageClass: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
*data = talloc_strdup (memCtx, "IPM.Appointment");
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
- (int) getPidLidSideEffects: (void **) data // TODO
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
|
@ -422,41 +417,28 @@
|
|||
return rc;
|
||||
}
|
||||
|
||||
- (void) _updateAttachedEvent: (MAPIStoreCalendarAttachment *) attachment
|
||||
withUID: (NSString *) uid
|
||||
{
|
||||
iCalEvent *newEvent;
|
||||
SOGoUser *activeUser;
|
||||
|
||||
newEvent = [iCalEvent groupWithTag: @"vevent"];
|
||||
[calendar addToEvents: newEvent];
|
||||
activeUser = [[self context] activeUser];
|
||||
[newEvent setUid: uid];
|
||||
[newEvent updateFromMAPIProperties: [attachment properties]
|
||||
inUserContext: [self userContext]
|
||||
withActiveUser: activeUser];
|
||||
}
|
||||
|
||||
- (void) _updateAttachedEvents
|
||||
{
|
||||
NSMutableArray *otherEvents;
|
||||
NSArray *allAttachments;
|
||||
NSUInteger count, max;
|
||||
NSString *uid;
|
||||
|
||||
/* cleanup all recurring events */
|
||||
otherEvents = [[calendar events] mutableCopy];
|
||||
[otherEvents removeObject: masterEvent];
|
||||
[calendar removeChildren: otherEvents];
|
||||
[otherEvents release];
|
||||
NSString *uid, *summary;
|
||||
iCalEvent *event;
|
||||
MAPIStoreCalendarAttachment *attachment;
|
||||
|
||||
/* ensure that all exception events have the same UID as the master */
|
||||
uid = [masterEvent uid];
|
||||
summary = [masterEvent summary];
|
||||
|
||||
allAttachments = [attachmentParts allValues];
|
||||
max = [allAttachments count];
|
||||
for (count = 0; count < max; count++)
|
||||
[self _updateAttachedEvent: [allAttachments objectAtIndex: count]
|
||||
withUID: uid];
|
||||
{
|
||||
attachment = [allAttachments objectAtIndex: count];
|
||||
event = [attachment event];
|
||||
if ([[event summary] length] == 0)
|
||||
[event setSummary: summary];
|
||||
[event setUid: uid];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) save
|
||||
|
@ -513,12 +495,17 @@
|
|||
MAPIStoreCalendarAttachment *newAttachment;
|
||||
uint32_t newAid;
|
||||
NSString *newKey;
|
||||
iCalEvent *newEvent;
|
||||
|
||||
newAid = [[self attachmentKeys] count];
|
||||
|
||||
newAttachment = [MAPIStoreCalendarAttachment
|
||||
mapiStoreObjectInContainer: self];
|
||||
[newAttachment setAID: newAid];
|
||||
newEvent = [iCalEvent groupWithTag: @"vevent"];
|
||||
[newAttachment setEvent: newEvent];
|
||||
[calendar addToEvents: newEvent];
|
||||
|
||||
newKey = [NSString stringWithFormat: @"%ul", newAid];
|
||||
[attachmentParts setObject: newAttachment
|
||||
forKey: newKey];
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
#import <Foundation/NSString.h>
|
||||
|
||||
#import "MAPIStoreAttachment.h"
|
||||
#import "MAPIStoreFolder.h"
|
||||
#import "NSObject+MAPIStore.h"
|
||||
|
||||
#import "MAPIStoreEmbeddedMessage.h"
|
||||
|
||||
|
@ -37,6 +39,30 @@ static Class MAPIStoreAttachmentK;
|
|||
MAPIStoreAttachmentK = [MAPIStoreAttachment class];
|
||||
}
|
||||
|
||||
- (uint64_t) objectId
|
||||
{
|
||||
NSString *objectKey;
|
||||
MAPIStoreMessage *grandParent;
|
||||
|
||||
grandParent = (MAPIStoreMessage *) [container container];
|
||||
|
||||
/* FIXME: this is a hack */
|
||||
objectKey = [NSString stringWithFormat: @"%@/%@/as-message",
|
||||
[grandParent nameInContainer],
|
||||
[container nameInContainer],
|
||||
[self nameInContainer]];
|
||||
|
||||
return [(MAPIStoreFolder *) [grandParent container]
|
||||
idForObjectWithKey: objectKey];
|
||||
}
|
||||
|
||||
- (int) getPidTagAccessLevel: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return [self getLongZero: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
/* disabled properties */
|
||||
- (int) getPidTagFolderId: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
|
@ -49,6 +75,12 @@ static Class MAPIStoreAttachmentK;
|
|||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
- (int) getPidTagSourceKey: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
- (int) getPidTagParentSourceKey: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
|
@ -61,6 +93,49 @@ static Class MAPIStoreAttachmentK;
|
|||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
- (int) getPidTagInstID: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
- (int) getPidTagInstanceNum: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
- (int) getPidTagRowType: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
- (int) getPidTagDepth: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
- (int) getPidTagIconIndex: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
- (int) getPidTagGenerateExchangeViews: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
- (int) getPidTagOriginalMessageClass: (void **) dataa
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return MAPISTORE_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
/* common methods */
|
||||
- (NSString *) nameInContainer
|
||||
{
|
||||
return @"as-message";
|
||||
|
|
Loading…
Reference in New Issue