diff --git a/ChangeLog b/ChangeLog index 4c1e165af..a49d526ff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2010-11-18 Wolfgang Sourdeau + * OpenChange/MAPIStoreContactsContext.m (-createMessageInFolder:): + implemented method and returns an instance of SOGoContactGCSEntry. + * OpenChange/SOGoContactGCSEntry+MAPIStore.m: new category module. (setMAPIProperties:) new method that resets the properties on the current object and update the corresponding record in the database. diff --git a/OpenChange/MAPIStoreContactsContext.m b/OpenChange/MAPIStoreContactsContext.m index 9d5b8e4a6..35c2d4236 100644 --- a/OpenChange/MAPIStoreContactsContext.m +++ b/OpenChange/MAPIStoreContactsContext.m @@ -40,21 +40,14 @@ #undef DEBUG #include -static Class SOGoUserFolderK; - @implementation MAPIStoreContactsContext -+ (void) initialize -{ - SOGoUserFolderK = [SOGoUserFolder class]; -} - - (void) setupModuleFolder { id userFolder; - userFolder = [SOGoUserFolderK objectWithName: [authenticator username] - inContainer: MAPIApp]; + userFolder = [SOGoUserFolder objectWithName: [authenticator username] + inContainer: MAPIApp]; [woContext setClientObject: userFolder]; [userFolder retain]; // LEAK @@ -182,7 +175,7 @@ static Class SOGoUserFolderK; *data = [stringValue asUnicodeInMemCtx: memCtx]; break; - case 0x3001001f: // Full Name + case PR_DISPLAY_NAME_UNICODE: // Full Name case 0x81c2001f: // contact block title name rc = [super getMessageTableChildproperty: data atURL: childURL @@ -276,6 +269,19 @@ static Class SOGoUserFolderK; return rc; } +- (id) createMessageInFolder: (id) parentFolder +{ + SOGoContactGCSEntry *newEntry; + NSString *name; + + name = [NSString stringWithFormat: @"%@.vcf", + [SOGoObject globallyUniqueObjectId]]; + newEntry = [SOGoContactGCSEntry objectWithName: name + inContainer: parentFolder]; + + return newEntry; +} + // - (int) getFolderTableChildproperty: (void **) data // atURL: (NSString *) childURL // withTag: (uint32_t) proptag