From c6b716ef62d54a3ff8a37f76627fb344ca6c5040 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 26 Oct 2011 15:15:17 +0000 Subject: [PATCH] Monotone-Parent: 8bcefff481572fc23caa92d92861c18902d781bd Monotone-Revision: 6d629d88d3b01fa71fac5c998333eed2c61c6232 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-10-26T15:15:17 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 6 +++ OpenChange/MAPIStoreCalendarMessage.m | 40 +++++++------- OpenChange/MAPIStoreContactsMessage.m | 78 +++++++++++++-------------- OpenChange/MAPIStoreDraftsMessage.m | 38 ++++++------- OpenChange/MAPIStoreFSMessage.m | 24 ++++----- OpenChange/MAPIStoreFolder.m | 16 +++--- OpenChange/MAPIStoreMailMessage.m | 2 +- OpenChange/MAPIStoreMemMailMessage.m | 47 ++++++++-------- OpenChange/MAPIStoreMessage.m | 14 ++--- OpenChange/MAPIStoreObject.h | 10 ++-- OpenChange/MAPIStoreObject.m | 22 ++++---- OpenChange/MAPIStoreSOGo.m | 2 +- OpenChange/MAPIStoreTasksMessage.m | 24 ++++----- 13 files changed, 164 insertions(+), 159 deletions(-) diff --git a/ChangeLog b/ChangeLog index a57b27d27..a92f140cb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2011-10-26 Wolfgang Sourdeau + * OpenChange/MAPIStoreObject.m (-init): renamed "newProperties" + ivar to "properties". + (-addNewProperties:): renamed to "-addProperties:" + (-resetNewProperties:): renamed to "-resetProperties:" + (-setProperties:): renamed to "-addPropertiesFromRow:" + * OpenChange/MAPIStoreSOGo.m (sogo_message_create_attachment): implemented new backend method. diff --git a/OpenChange/MAPIStoreCalendarMessage.m b/OpenChange/MAPIStoreCalendarMessage.m index 679935989..289c5a547 100644 --- a/OpenChange/MAPIStoreCalendarMessage.m +++ b/OpenChange/MAPIStoreCalendarMessage.m @@ -508,7 +508,7 @@ /* NOTE: we only handle the generic case at the moment, see MAPIStoreAppointmentWrapper */ - objectId = [newProperties objectForKey: MAPIPropertyKey (PidLidGlobalObjectId)]; + objectId = [properties objectForKey: MAPIPropertyKey (PidLidGlobalObjectId)]; if (objectId) { length = [objectId length]; @@ -588,11 +588,11 @@ if (alarm) [newEvent removeChild: alarm]; - if ([[newProperties objectForKey: MAPIPropertyKey (PidLidReminderSet)] + if ([[properties objectForKey: MAPIPropertyKey (PidLidReminderSet)] boolValue]) { - delta = [newProperties - objectForKey: MAPIPropertyKey (PidLidReminderDelta)]; + delta + = [properties objectForKey: MAPIPropertyKey (PidLidReminderDelta)]; if (delta) { alarm = [iCalAlarm new]; @@ -658,7 +658,7 @@ NSString *newPartStat; value - = [newProperties objectForKey: MAPIPropertyKey (PidLidResponseStatus)]; + = [properties objectForKey: MAPIPropertyKey (PidLidResponseStatus)]; if (value) responseStatus = [value unsignedLongValue]; @@ -701,13 +701,13 @@ [newEvent setLastModified: now]; // summary - value = [newProperties + value = [properties objectForKey: MAPIPropertyKey (PR_NORMALIZED_SUBJECT_UNICODE)]; if (value) [newEvent setSummary: value]; // Location - value = [newProperties objectForKey: MAPIPropertyKey (PidLidLocation)]; + value = [properties objectForKey: MAPIPropertyKey (PidLidLocation)]; if (value) [newEvent setLocation: value]; @@ -716,9 +716,9 @@ [vCalendar addTimeZone: tz]; // start - value = [newProperties objectForKey: MAPIPropertyKey (PR_START_DATE)]; + value = [properties objectForKey: MAPIPropertyKey (PR_START_DATE)]; if (!value) - value = [newProperties + value = [properties objectForKey: MAPIPropertyKey (PidLidAppointmentStartWhole)]; if (value) { @@ -728,9 +728,9 @@ } /* end */ - value = [newProperties objectForKey: MAPIPropertyKey(PR_END_DATE)]; + value = [properties objectForKey: MAPIPropertyKey(PR_END_DATE)]; if (!value) - value = [newProperties objectForKey: MAPIPropertyKey(PidLidAppointmentEndWhole)]; + value = [properties objectForKey: MAPIPropertyKey(PidLidAppointmentEndWhole)]; if (value) { end = (iCalDateTime *) [newEvent uniqueChildWithTag: @"dtend"]; @@ -739,7 +739,7 @@ } /* priority */ - value = [newProperties objectForKey: MAPIPropertyKey(PR_IMPORTANCE)]; + value = [properties objectForKey: MAPIPropertyKey(PR_IMPORTANCE)]; if (value) { switch ([value intValue]) @@ -763,7 +763,7 @@ 0x00000001 - olTentative 0x00000002 - olBusy 0x00000003 - olOutOfOffice */ - value = [newProperties objectForKey: MAPIPropertyKey(PidLidBusyStatus)]; + value = [properties objectForKey: MAPIPropertyKey(PidLidBusyStatus)]; if (value) { switch ([value intValue]) @@ -780,7 +780,7 @@ } /* recurrence */ - value = [newProperties + value = [properties objectForKey: MAPIPropertyKey (PidLidAppointmentRecur)]; if (value) [self _setupRecurrenceInCalendar: vCalendar @@ -794,11 +794,11 @@ [self _setupAlarmDataInEvent: newEvent]; // Organizer - value = [newProperties objectForKey: @"recipients"]; + value = [properties objectForKey: @"recipients"]; if (value) { NSArray *recipients; - NSDictionary *dict, *properties; + NSDictionary *dict, *recipientProperties; iCalPerson *person; iCalPersonPartStat newPartStat; NSNumber *flags, *trackStatus; @@ -819,8 +819,8 @@ for (i = 0; i < [recipients count]; i++) { dict = [recipients objectAtIndex: i]; - properties = [dict objectForKey: @"properties"]; - flags = [properties + recipientProperties = [dict objectForKey: @"properties"]; + flags = [recipientProperties objectForKey: MAPIPropertyKey (PR_RECIPIENT_FLAGS)]; if (!flags) { @@ -837,7 +837,7 @@ else { trackStatus - = [properties + = [recipientProperties objectForKey: MAPIPropertyKey (PR_RECIPIENT_TRACKSTATUS)]; /* FIXME: we should provide a data converter between OL @@ -870,7 +870,7 @@ [sogoObject saveComponent: newEvent]; } [(MAPIStoreCalendarFolder *) container synchroniseCache]; - value = [newProperties objectForKey: MAPIPropertyKey (PR_CHANGE_KEY)]; + value = [properties objectForKey: MAPIPropertyKey (PR_CHANGE_KEY)]; if (value) [(MAPIStoreCalendarFolder *) container setChangeKey: value forMessageWithKey: [self nameInContainer]]; diff --git a/OpenChange/MAPIStoreContactsMessage.m b/OpenChange/MAPIStoreContactsMessage.m index 6378ce662..915eba161 100644 --- a/OpenChange/MAPIStoreContactsMessage.m +++ b/OpenChange/MAPIStoreContactsMessage.m @@ -856,7 +856,7 @@ int postalAddressId; id value; - [self logWithFormat: @"setMAPIProperties: %@", newProperties]; + [self logWithFormat: @"setMAPIProperties: %@", properties]; newCard = [sogoObject vCard]; [newCard setTag: @"vcard"]; @@ -865,16 +865,16 @@ [newCard setProfile: @"vCard"]; // Decomposed fullname - [newCard setNWithFamily: [newProperties objectForKey: MAPIPropertyKey(PR_SURNAME_UNICODE)] - given: [newProperties objectForKey: MAPIPropertyKey(PR_GIVEN_NAME_UNICODE)] - additional: [newProperties objectForKey: MAPIPropertyKey(PR_MIDDLE_NAME_UNICODE)] - prefixes: [newProperties objectForKey: MAPIPropertyKey(PR_DISPLAY_NAME_PREFIX_UNICODE)] - suffixes: [newProperties objectForKey: MAPIPropertyKey(PR_GENERATION_UNICODE)]]; + [newCard setNWithFamily: [properties objectForKey: MAPIPropertyKey(PR_SURNAME_UNICODE)] + given: [properties objectForKey: MAPIPropertyKey(PR_GIVEN_NAME_UNICODE)] + additional: [properties objectForKey: MAPIPropertyKey(PR_MIDDLE_NAME_UNICODE)] + prefixes: [properties objectForKey: MAPIPropertyKey(PR_DISPLAY_NAME_PREFIX_UNICODE)] + suffixes: [properties objectForKey: MAPIPropertyKey(PR_GENERATION_UNICODE)]]; // // display name // - value = [newProperties objectForKey: MAPIPropertyKey(PR_DISPLAY_NAME_UNICODE)]; + value = [properties objectForKey: MAPIPropertyKey(PR_DISPLAY_NAME_UNICODE)]; if (value) [newCard setFn: value]; @@ -882,7 +882,7 @@ // email addresses handling // elements = [newCard childrenWithTag: @"email"]; - value = [newProperties objectForKey: MAPIPropertyKey(PidLidEmail1EmailAddress)]; + value = [properties objectForKey: MAPIPropertyKey(PidLidEmail1EmailAddress)]; if (value) { if ([elements count] > 0) @@ -891,7 +891,7 @@ [newCard addEmail: value types: [NSArray arrayWithObject: @"pref"]]; } - value = [newProperties objectForKey: MAPIPropertyKey (PidLidEmail2EmailAddress)]; + value = [properties objectForKey: MAPIPropertyKey (PidLidEmail2EmailAddress)]; if (value) { if ([elements count] > 1) @@ -899,7 +899,7 @@ else [newCard addEmail: value types: nil]; } - value = [newProperties objectForKey: MAPIPropertyKey (PidLidEmail3EmailAddress)]; + value = [properties objectForKey: MAPIPropertyKey (PidLidEmail3EmailAddress)]; if (value) { if ([elements count] > 2) @@ -919,10 +919,10 @@ // 0x00000003 - The Other Address is the Mailing Address. // // - postalAddressId = [[newProperties objectForKey: MAPIPropertyKey (PidLidPostalAddressId)] + postalAddressId = [[properties objectForKey: MAPIPropertyKey (PidLidPostalAddressId)] intValue]; - value = [newProperties objectForKey: MAPIPropertyKey(PidLidWorkAddress)]; + value = [properties objectForKey: MAPIPropertyKey(PidLidWorkAddress)]; if ([value length]) { elements = [newCard childrenWithTag: @"label" @@ -959,29 +959,29 @@ } if (postalAddressId == 2) [element addAttribute: @"type" value: @"pref"]; - value = [newProperties objectForKey: MAPIPropertyKey(PidLidWorkAddressPostOfficeBox)]; + value = [properties objectForKey: MAPIPropertyKey(PidLidWorkAddressPostOfficeBox)]; if (value) [element setValue: 0 to: value]; - value = [newProperties objectForKey: MAPIPropertyKey(PidLidWorkAddressStreet)]; + value = [properties objectForKey: MAPIPropertyKey(PidLidWorkAddressStreet)]; if (value) [element setValue: 2 to: value]; - value = [newProperties objectForKey: MAPIPropertyKey(PidLidWorkAddressCity)]; + value = [properties objectForKey: MAPIPropertyKey(PidLidWorkAddressCity)]; if (value) [element setValue: 3 to: value]; - value = [newProperties objectForKey: MAPIPropertyKey(PidLidWorkAddressState)]; + value = [properties objectForKey: MAPIPropertyKey(PidLidWorkAddressState)]; if (value) [element setValue: 4 to: value]; - value = [newProperties objectForKey: MAPIPropertyKey(PidLidWorkAddressPostalCode)]; + value = [properties objectForKey: MAPIPropertyKey(PidLidWorkAddressPostalCode)]; if (value) [element setValue: 5 to: value]; - value = [newProperties objectForKey: MAPIPropertyKey(PidLidWorkAddressCountry)]; + value = [properties objectForKey: MAPIPropertyKey(PidLidWorkAddressCountry)]; if (value) [element setValue: 6 to: value]; // // home postal addresses handling // - value = [newProperties objectForKey: MAPIPropertyKey(PidLidHomeAddress)]; + value = [properties objectForKey: MAPIPropertyKey(PidLidHomeAddress)]; if ([value length]) { elements = [newCard childrenWithTag: @"label" @@ -1019,22 +1019,22 @@ if (postalAddressId == 1) [element addAttribute: @"type" value: @"pref"]; - value = [newProperties objectForKey: MAPIPropertyKey(PR_HOME_ADDRESS_POST_OFFICE_BOX_UNICODE)]; + value = [properties objectForKey: MAPIPropertyKey(PR_HOME_ADDRESS_POST_OFFICE_BOX_UNICODE)]; if (value) [element setValue: 0 to: value]; - value = [newProperties objectForKey: MAPIPropertyKey( PR_HOME_ADDRESS_STREET_UNICODE)]; + value = [properties objectForKey: MAPIPropertyKey( PR_HOME_ADDRESS_STREET_UNICODE)]; if (value) [element setValue: 2 to: value]; - value = [newProperties objectForKey: MAPIPropertyKey(PR_HOME_ADDRESS_CITY_UNICODE)]; + value = [properties objectForKey: MAPIPropertyKey(PR_HOME_ADDRESS_CITY_UNICODE)]; if (value) [element setValue: 3 to: value]; - value = [newProperties objectForKey: MAPIPropertyKey(PR_HOME_ADDRESS_STATE_OR_PROVINCE_UNICODE)]; + value = [properties objectForKey: MAPIPropertyKey(PR_HOME_ADDRESS_STATE_OR_PROVINCE_UNICODE)]; if (value) [element setValue: 4 to: value]; - value = [newProperties objectForKey: MAPIPropertyKey(PR_HOME_ADDRESS_POSTAL_CODE_UNICODE)]; + value = [properties objectForKey: MAPIPropertyKey(PR_HOME_ADDRESS_POSTAL_CODE_UNICODE)]; if (value) [element setValue: 5 to: value]; - value = [newProperties objectForKey: MAPIPropertyKey(PR_HOME_ADDRESS_COUNTRY_UNICODE)]; + value = [properties objectForKey: MAPIPropertyKey(PR_HOME_ADDRESS_COUNTRY_UNICODE)]; if (value) [element setValue: 6 to: value]; @@ -1043,27 +1043,27 @@ // telephone numbers: work, home, fax, pager and mobile // element = [self _elementWithTag: @"tel" ofType: @"work" forCard: newCard]; - value = [newProperties objectForKey: MAPIPropertyKey(PR_OFFICE_TELEPHONE_NUMBER_UNICODE)]; + value = [properties objectForKey: MAPIPropertyKey(PR_OFFICE_TELEPHONE_NUMBER_UNICODE)]; if (value) [element setValue: 0 to: value]; element = [self _elementWithTag: @"tel" ofType: @"home" forCard: newCard]; - value = [newProperties objectForKey: MAPIPropertyKey(PR_HOME_TELEPHONE_NUMBER_UNICODE)]; + value = [properties objectForKey: MAPIPropertyKey(PR_HOME_TELEPHONE_NUMBER_UNICODE)]; if (value) [element setValue: 0 to: value]; element = [self _elementWithTag: @"tel" ofType: @"fax" forCard: newCard]; - value = [newProperties objectForKey: MAPIPropertyKey(PR_BUSINESS_FAX_NUMBER_UNICODE)]; + value = [properties objectForKey: MAPIPropertyKey(PR_BUSINESS_FAX_NUMBER_UNICODE)]; if (value) [element setValue: 0 to: value]; element = [self _elementWithTag: @"tel" ofType: @"pager" forCard: newCard]; - value = [newProperties objectForKey: MAPIPropertyKey(PR_PAGER_TELEPHONE_NUMBER_UNICODE)]; + value = [properties objectForKey: MAPIPropertyKey(PR_PAGER_TELEPHONE_NUMBER_UNICODE)]; if (value) [element setValue: 0 to: value]; element = [self _elementWithTag: @"tel" ofType: @"cell" forCard: newCard]; - value = [newProperties objectForKey: MAPIPropertyKey(PR_MOBILE_TELEPHONE_NUMBER_UNICODE)]; + value = [properties objectForKey: MAPIPropertyKey(PR_MOBILE_TELEPHONE_NUMBER_UNICODE)]; if (value) [element setValue: 0 to: value]; @@ -1071,32 +1071,32 @@ // // job title, nickname, company name, deparment, work url, im address/screen name and birthday // - value = [newProperties objectForKey: MAPIPropertyKey(PR_TITLE_UNICODE)]; + value = [properties objectForKey: MAPIPropertyKey(PR_TITLE_UNICODE)]; if (value) [newCard setTitle: value]; - value = [newProperties objectForKey: MAPIPropertyKey(PR_NICKNAME_UNICODE)]; + value = [properties objectForKey: MAPIPropertyKey(PR_NICKNAME_UNICODE)]; if (value) [newCard setNickname: value]; - value = [newProperties objectForKey: MAPIPropertyKey(PR_DEPARTMENT_NAME_UNICODE)]; + value = [properties objectForKey: MAPIPropertyKey(PR_DEPARTMENT_NAME_UNICODE)]; if (value) units = [NSArray arrayWithObject: value]; else units = nil; - value = [newProperties objectForKey: MAPIPropertyKey(PR_COMPANY_NAME_UNICODE)]; + value = [properties objectForKey: MAPIPropertyKey(PR_COMPANY_NAME_UNICODE)]; if (value) [newCard setOrg: value units: units]; - value = [newProperties objectForKey: MAPIPropertyKey(PR_BUSINESS_HOME_PAGE_UNICODE)]; + value = [properties objectForKey: MAPIPropertyKey(PR_BUSINESS_HOME_PAGE_UNICODE)]; if (value) { [[self _elementWithTag: @"url" ofType: @"work" forCard: newCard] setValue: 0 to: value]; } - value = [newProperties objectForKey: MAPIPropertyKey(PidLidInstantMessagingAddress)]; + value = [properties objectForKey: MAPIPropertyKey(PidLidInstantMessagingAddress)]; if (value) { [[newCard uniqueChildWithTag: @"x-aim"] @@ -1104,7 +1104,7 @@ to: value]; } - value = [newProperties objectForKey: MAPIPropertyKey(PR_BIRTHDAY)]; + value = [properties objectForKey: MAPIPropertyKey(PR_BIRTHDAY)]; if (value) { [newCard setBday: [value descriptionWithCalendarFormat: @"%Y-%m-%d"]]; @@ -1115,7 +1115,7 @@ { attachment = [[attachmentParts allValues] objectAtIndex: 0]; [self _updatePhotoInVCard: newCard - fromProperties: [attachment newProperties]]; + fromProperties: [attachment properties]]; } // @@ -1123,7 +1123,7 @@ // [sogoObject saveContentString: [newCard versitString]]; [(MAPIStoreContactsFolder *) container synchroniseCache]; - value = [newProperties objectForKey: MAPIPropertyKey (PR_CHANGE_KEY)]; + value = [properties objectForKey: MAPIPropertyKey (PR_CHANGE_KEY)]; if (value) [(MAPIStoreContactsFolder *) container setChangeKey: value forMessageWithKey: [self nameInContainer]]; diff --git a/OpenChange/MAPIStoreDraftsMessage.m b/OpenChange/MAPIStoreDraftsMessage.m index 47f3fe57e..d4402cf46 100644 --- a/OpenChange/MAPIStoreDraftsMessage.m +++ b/OpenChange/MAPIStoreDraftsMessage.m @@ -331,26 +331,26 @@ typedef void (*getMessageData_inMemCtx_) (MAPIStoreMessage *, SEL, - (void) _saveAttachment: (NSString *) attachmentKey { - NSDictionary *properties, *metadata; + NSDictionary *attProperties, *metadata; NSString *filename, *mimeType; NSData *content; MAPIStoreAttachment *attachment; attachment = [attachmentParts objectForKey: attachmentKey]; - properties = [attachment newProperties]; + attProperties = [attachment properties]; filename - = [properties + = [attProperties objectForKey: MAPIPropertyKey (PR_ATTACH_LONG_FILENAME_UNICODE)]; if (![filename length]) { filename - = [properties + = [attProperties objectForKey: MAPIPropertyKey (PR_ATTACH_FILENAME_UNICODE)]; if (![filename length]) filename = @"untitled.bin"; } - mimeType = [properties + mimeType = [attProperties objectForKey: MAPIPropertyKey (PR_ATTACH_MIME_TAG_UNICODE)]; if (!mimeType) mimeType = [[MAPIStoreMIME sharedMAPIStoreMIME] @@ -358,7 +358,7 @@ typedef void (*getMessageData_inMemCtx_) (MAPIStoreMessage *, SEL, if (!mimeType) mimeType = @"application/octet-stream"; - content = [properties objectForKey: MAPIPropertyKey (PR_ATTACH_DATA_BIN)]; + content = [attProperties objectForKey: MAPIPropertyKey (PR_ATTACH_DATA_BIN)]; if (content) { metadata = [NSDictionary dictionaryWithObjectsAndKeys: @@ -385,7 +385,7 @@ typedef void (*getMessageData_inMemCtx_) (MAPIStoreMessage *, SEL, newHeaders = [NSMutableDictionary dictionaryWithCapacity: 7]; /* save the recipients */ - recipients = [newProperties objectForKey: @"recipients"]; + recipients = [properties objectForKey: @"recipients"]; if (recipients) { for (count = 0; count < 3; count++) @@ -413,16 +413,16 @@ e) /* save the subject */ subject = [NSMutableString stringWithCapacity: 128]; - value = [newProperties objectForKey: MAPIPropertyKey (PR_SUBJECT_UNICODE)]; + value = [properties objectForKey: MAPIPropertyKey (PR_SUBJECT_UNICODE)]; if (value) [subject appendString: value]; else { - value = [newProperties + value = [properties objectForKey: MAPIPropertyKey (PR_SUBJECT_PREFIX_UNICODE)]; if (value) [subject appendString: value]; - value = [newProperties + value = [properties objectForKey: MAPIPropertyKey (PR_NORMALIZED_SUBJECT_UNICODE)]; if (value) [subject appendString: value]; @@ -440,7 +440,7 @@ e) 0x00000000 == Low importance 0x00000001 == Normal importance 0x00000002 == High importance */ - value = [newProperties objectForKey: MAPIPropertyKey (PR_IMPORTANCE)]; + value = [properties objectForKey: MAPIPropertyKey (PR_IMPORTANCE)]; if (value && [value intValue] == 0x0) { [newHeaders setObject: @"LOW" forKey: @"priority"]; @@ -453,7 +453,7 @@ e) /* save the newly generated headers */ [sogoObject setHeaders: newHeaders]; - value = [newProperties objectForKey: MAPIPropertyKey (PR_HTML)]; + value = [properties objectForKey: MAPIPropertyKey (PR_HTML)]; if (value) { [sogoObject setIsHTML: YES]; @@ -465,7 +465,7 @@ e) } else { - value = [newProperties objectForKey: MAPIPropertyKey (PR_BODY_UNICODE)]; + value = [properties objectForKey: MAPIPropertyKey (PR_BODY_UNICODE)]; if (value) { [sogoObject setIsHTML: NO]; @@ -612,7 +612,7 @@ e) NSException *error; MAPIStoreMapping *mapping; - msgClass = [newProperties + msgClass = [properties objectForKey: MAPIPropertyKey (PR_MESSAGE_CLASS_UNICODE)]; if (![msgClass isEqualToString: @"IPM.Schedule.Meeting.Request"]) { @@ -637,7 +637,7 @@ e) { [self submit]; [self setIsNew: NO]; - [self resetNewProperties]; + [self resetProperties]; [[self container] cleanupCaches]; rc = MAPISTORE_SUCCESS; } @@ -657,7 +657,7 @@ e) if ([sogoObject isKindOfClass: SOGoDraftObjectK]) { - msgClass = [newProperties + msgClass = [properties objectForKey: MAPIPropertyKey (PR_MESSAGE_CLASS_UNICODE)]; if (![msgClass isEqualToString: @"IPM.Schedule.Meeting.Request"]) { @@ -679,7 +679,7 @@ e) if ([sogoObject isKindOfClass: SOGoDraftObjectK]) { - subject = [newProperties objectForKey: MAPIPropertyKey (PR_SUBJECT_UNICODE)]; + subject = [properties objectForKey: MAPIPropertyKey (PR_SUBJECT_UNICODE)]; if (!subject) { if (!headerSetup) @@ -696,14 +696,14 @@ e) - (NSDate *) creationTime { return ([sogoObject isKindOfClass: SOGoDraftObjectK] - ? (NSDate *) [newProperties objectForKey: MAPIPropertyKey (PR_CREATION_TIME)] + ? (NSDate *) [properties objectForKey: MAPIPropertyKey (PR_CREATION_TIME)] : [super creationTime]); } - (NSDate *) lastModificationTime { return ([sogoObject isKindOfClass: SOGoDraftObjectK] - ? (NSDate *) [newProperties + ? (NSDate *) [properties objectForKey: MAPIPropertyKey (PR_LAST_MODIFICATION_TIME)] : [super lastModificationTime]); } diff --git a/OpenChange/MAPIStoreFSMessage.m b/OpenChange/MAPIStoreFSMessage.m index 0432d8cbb..cf1b49818 100644 --- a/OpenChange/MAPIStoreFSMessage.m +++ b/OpenChange/MAPIStoreFSMessage.m @@ -153,14 +153,14 @@ Class NSNumberK; NSArray *keys; NSUInteger count, max; NSString *key; - struct SPropTagArray *properties; + struct SPropTagArray *availableProps; keys = [[sogoObject properties] allKeys]; max = [keys count]; - properties = talloc_zero (NULL, struct SPropTagArray); - properties->cValues = max; - properties->aulPropTag = talloc_array (properties, enum MAPITAGS, max); + availableProps = talloc_zero (NULL, struct SPropTagArray); + availableProps->cValues = max; + availableProps->aulPropTag = talloc_array (availableProps, enum MAPITAGS, max); for (count = 0; count < max; count++) { // #if (GS_SIZEOF_LONG == 4) @@ -172,14 +172,14 @@ Class NSNumberK; if ([key isKindOfClass: NSNumberK]) { #if (GS_SIZEOF_LONG == 4) - properties->aulPropTag[count] = [[keys objectAtIndex: count] unsignedLongValue]; + availableProps->aulPropTag[count] = [[keys objectAtIndex: count] unsignedLongValue]; #elif (GS_SIZEOF_INT == 4) - properties->aulPropTag[count] = [[keys objectAtIndex: count] unsignedIntValue]; + availableProps->aulPropTag[count] = [[keys objectAtIndex: count] unsignedIntValue]; #endif } } - *propertiesP = properties; + *propertiesP = availableProps; return MAPISTORE_SUCCESS; } @@ -221,17 +221,17 @@ Class NSNumberK; uint64_t newVersion; if ([attachmentKeys count] > 0) - [newProperties setObject: attachmentParts forKey: @"attachments"]; + [properties setObject: attachmentParts forKey: @"attachments"]; newVersion = exchange_globcnt ([[self context] getNewChangeNumber] >> 16); - [newProperties setObject: [NSNumber numberWithUnsignedLongLong: newVersion] + [properties setObject: [NSNumber numberWithUnsignedLongLong: newVersion] forKey: @"version"]; - [self logWithFormat: @"%d props in dict", [newProperties count]]; + [self logWithFormat: @"%d props in dict", [properties count]]; - [sogoObject appendProperties: newProperties]; + [sogoObject appendProperties: properties]; [sogoObject save]; - [self resetNewProperties]; + [self resetProperties]; } - (NSDate *) creationTime diff --git a/OpenChange/MAPIStoreFolder.m b/OpenChange/MAPIStoreFolder.m index 3bfc66a88..9083cbe24 100644 --- a/OpenChange/MAPIStoreFolder.m +++ b/OpenChange/MAPIStoreFolder.m @@ -352,7 +352,7 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe childFolder = [self lookupFolder: folderKey]; if (childFolder) { - [childFolder setProperties: aRow]; + [childFolder addPropertiesFromRow: aRow]; *childFolderPtr = childFolder; } else @@ -628,7 +628,7 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe isAssociated: [sourceMsg isKindOfClass: MAPIStoreFAIMessageK]]; if (rc != MAPISTORE_SUCCESS) goto end; - rc = [destMsg setProperties: aRow]; + rc = [destMsg addPropertiesFromRow: aRow]; if (rc != MAPISTORE_SUCCESS) goto end; [destMsg save]; @@ -898,7 +898,7 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe return rc; } -- (int) setProperties: (struct SRow *) aRow +- (int) addPropertiesFromRow: (struct SRow *) aRow { static enum MAPITAGS bannedProps[] = { PR_MID, PR_FID, PR_PARENT_FID, PR_SOURCE_KEY, PR_PARENT_SOURCE_KEY, @@ -906,22 +906,22 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe enum MAPITAGS *currentProp; int rc; - rc = [super setProperties: aRow]; + rc = [super addPropertiesFromRow: aRow]; /* TODO: this should no longer be required once mapistore v2 API is in place, when we can then do this from -dealloc below */ - if ([newProperties count] > 0) + if ([properties count] > 0) { currentProp = bannedProps; while (*currentProp) { - [newProperties removeObjectForKey: MAPIPropertyKey (*currentProp)]; + [properties removeObjectForKey: MAPIPropertyKey (*currentProp)]; currentProp++; } - [propsMessage appendProperties: newProperties]; + [propsMessage appendProperties: properties]; [propsMessage save]; - [self resetNewProperties]; + [self resetProperties]; } return rc; diff --git a/OpenChange/MAPIStoreMailMessage.m b/OpenChange/MAPIStoreMailMessage.m index 7097d6900..568252629 100644 --- a/OpenChange/MAPIStoreMailMessage.m +++ b/OpenChange/MAPIStoreMailMessage.m @@ -1529,7 +1529,7 @@ _compareBodyKeysByPriority (id entry1, id entry2, void *data) { NSNumber *value; - value = [newProperties objectForKey: MAPIPropertyKey (PR_FLAG_STATUS)]; + value = [properties objectForKey: MAPIPropertyKey (PR_FLAG_STATUS)]; if (value) { /* We don't handle the concept of "Follow Up" */ diff --git a/OpenChange/MAPIStoreMemMailMessage.m b/OpenChange/MAPIStoreMemMailMessage.m index 920835dd1..9311c76b7 100644 --- a/OpenChange/MAPIStoreMemMailMessage.m +++ b/OpenChange/MAPIStoreMemMailMessage.m @@ -60,15 +60,15 @@ Class NSNumberK; NSNumberK = [NSNumber class]; } -- (int) setProperties: (struct SRow *) aRow +- (int) addPropertiesFromRow: (struct SRow *) aRow { int rc; - rc = [super setProperties: aRow]; + rc = [super addPropertiesFromRow: aRow]; if (rc == MAPISTORE_SUCCESS) { - [sogoObject appendProperties: newProperties]; - [newProperties removeAllObjects]; + [sogoObject appendProperties: properties]; + [properties removeAllObjects]; } return rc; @@ -103,28 +103,28 @@ Class NSNumberK; NSArray *keys; NSUInteger count, max; NSString *key; - struct SPropTagArray *properties; + struct SPropTagArray *availableProps; keys = [[sogoObject properties] allKeys]; max = [keys count]; - properties = talloc_zero (NULL, struct SPropTagArray); - properties->cValues = max; - properties->aulPropTag = talloc_array (properties, enum MAPITAGS, max); + availableProps = talloc_zero (NULL, struct SPropTagArray); + availableProps->cValues = max; + availableProps->aulPropTag = talloc_array (availableProps, enum MAPITAGS, max); for (count = 0; count < max; count++) { key = [keys objectAtIndex: count]; if ([key isKindOfClass: NSNumberK]) { #if (GS_SIZEOF_LONG == 4) - properties->aulPropTag[count] = [[keys objectAtIndex: count] unsignedLongValue]; + availableProps->aulPropTag[count] = [[keys objectAtIndex: count] unsignedLongValue]; #elif (GS_SIZEOF_INT == 4) - properties->aulPropTag[count] = [[keys objectAtIndex: count] unsignedIntValue]; + availableProps->aulPropTag[count] = [[keys objectAtIndex: count] unsignedIntValue]; #endif } } - *propertiesP = properties; + *propertiesP = availableProps; return MAPISTORE_SUCCESS; } @@ -206,11 +206,10 @@ Class NSNumberK; return result; } - - (void) save { static NSString *recIds[] = { @"to", @"cc", @"bcc" }; - NSDictionary *properties; + NSDictionary *mailProperties; NSMutableString *subject; NSString *from, *recId, *messageId, *subjectData, *body, *folderName, *flag, *newIdString, *charset; @@ -230,17 +229,17 @@ Class NSNumberK; uint64_t mid; NSUInteger count; - properties = [sogoObject properties]; + mailProperties = [sogoObject properties]; /* headers */ map = [[[NGMutableHashMap alloc] initWithCapacity:16] autorelease]; - from = [self _quoteSpecials: [properties objectForKey: MAPIPropertyKey (PR_ORIGINAL_AUTHOR_NAME_UNICODE)]]; + from = [self _quoteSpecials: [mailProperties objectForKey: MAPIPropertyKey (PR_ORIGINAL_AUTHOR_NAME_UNICODE)]]; if ([from length]) [map setObject: from forKey: @"from"]; /* save the recipients */ - recipients = [properties objectForKey: @"recipients"]; + recipients = [mailProperties objectForKey: @"recipients"]; if (recipients) { for (count = 0; count < 3; count++) @@ -256,29 +255,29 @@ Class NSNumberK; [self errorWithFormat: @"message without recipients"]; subject = [NSMutableString stringWithCapacity: 128]; - subjectData = [properties objectForKey: MAPIPropertyKey (PR_SUBJECT_PREFIX_UNICODE)]; + subjectData = [mailProperties objectForKey: MAPIPropertyKey (PR_SUBJECT_PREFIX_UNICODE)]; if (subjectData) [subject appendString: subjectData]; - subjectData = [properties objectForKey: MAPIPropertyKey (PR_NORMALIZED_SUBJECT_UNICODE)]; + subjectData = [mailProperties objectForKey: MAPIPropertyKey (PR_NORMALIZED_SUBJECT_UNICODE)]; if (subjectData) [subject appendString: subjectData]; [map setObject: [subject asQPSubjectString: @"utf-8"] forKey: @"subject"]; - messageId = [properties objectForKey: MAPIPropertyKey (PR_INTERNET_MESSAGE_ID_UNICODE)]; + messageId = [mailProperties objectForKey: MAPIPropertyKey (PR_INTERNET_MESSAGE_ID_UNICODE)]; if ([messageId length]) [map setObject: messageId forKey: @"message-id"]; - date = [properties objectForKey: MAPIPropertyKey (PR_CLIENT_SUBMIT_TIME)]; + date = [mailProperties objectForKey: MAPIPropertyKey (PR_CLIENT_SUBMIT_TIME)]; if (date) [map addObject: [date rfc822DateString] forKey: @"date"]; [map addObject: @"1.0" forKey: @"MIME-Version"]; - htmlData = [properties objectForKey: MAPIPropertyKey (PR_HTML)]; + htmlData = [mailProperties objectForKey: MAPIPropertyKey (PR_HTML)]; if (htmlData) { /* charset */ charset = @"us-ascii"; - codePage = [properties objectForKey: MAPIPropertyKey (PR_INTERNET_CPID)]; + codePage = [mailProperties objectForKey: MAPIPropertyKey (PR_INTERNET_CPID)]; switch ([codePage intValue]) { case 20127: @@ -313,7 +312,7 @@ Class NSNumberK; } else { - body = [properties objectForKey: MAPIPropertyKey (PR_BODY_UNICODE)]; + body = [mailProperties objectForKey: MAPIPropertyKey (PR_BODY_UNICODE)]; if (body) [message setBody: body]; } @@ -348,7 +347,7 @@ Class NSNumberK; /* synchronise the cache and update the change key with the one provided by the client */ [(MAPIStoreMailFolder *) container synchroniseCache]; - changeKey = [properties objectForKey: MAPIPropertyKey (PR_CHANGE_KEY)]; + changeKey = [mailProperties objectForKey: MAPIPropertyKey (PR_CHANGE_KEY)]; if (changeKey) [(MAPIStoreMailFolder *) container setChangeKey: changeKey forMessageWithKey: [self nameInContainer]]; diff --git a/OpenChange/MAPIStoreMessage.m b/OpenChange/MAPIStoreMessage.m index 552e567be..2af0e44b2 100644 --- a/OpenChange/MAPIStoreMessage.m +++ b/OpenChange/MAPIStoreMessage.m @@ -206,7 +206,7 @@ NSData *MAPIStoreExternalEntryId (NSString *cn, NSString *email) - (NSDictionary *) _convertRecipientFromRow: (struct RecipientRow *) row andColumns: (struct SPropTagArray *) columns { - NSMutableDictionary *recipient, *properties; + NSMutableDictionary *recipient, *recipientProperties; SOGoUser *recipientUser; NSUInteger count, dataPos; struct mapi_SPropValue mapiValue; @@ -264,8 +264,8 @@ NSData *MAPIStoreExternalEntryId (NSString *cn, NSString *email) [recipient setObject: value forKey: @"fullName"]; } - properties = [NSMutableDictionary new]; - [recipient setObject: properties forKey: @"properties"]; + recipientProperties = [NSMutableDictionary new]; + [recipient setObject: recipientProperties forKey: @"properties"]; dataPos = 0; memCtx = talloc_zero (NULL, TALLOC_CTX); @@ -286,9 +286,9 @@ NSData *MAPIStoreExternalEntryId (NSString *cn, NSString *email) value = NSObjectFromMAPISPropValue (&mapiValue); dataPos += get_mapi_property_size (&mapiValue); if (value) - [properties setObject: value forKey: MAPIPropertyKey (columns->aulPropTag[count])]; + [recipientProperties setObject: value forKey: MAPIPropertyKey (columns->aulPropTag[count])]; } - [properties release]; + [recipientProperties release]; talloc_free (memCtx); return recipient; @@ -333,7 +333,7 @@ NSData *MAPIStoreExternalEntryId (NSString *cn, NSString *email) andColumns: columns]]; } } - [self addNewProperties: recipientProperties]; + [self addProperties: recipientProperties]; return MAPISTORE_SUCCESS; } @@ -494,7 +494,7 @@ NSData *MAPIStoreExternalEntryId (NSString *cn, NSString *email) [[containerTables objectAtIndex: count] notifyChangesForChild: self]; [self setIsNew: NO]; - [self resetNewProperties]; + [self resetProperties]; [container cleanupCaches]; return MAPISTORE_SUCCESS; diff --git a/OpenChange/MAPIStoreObject.h b/OpenChange/MAPIStoreObject.h index d68023aae..f5d89bb17 100644 --- a/OpenChange/MAPIStoreObject.h +++ b/OpenChange/MAPIStoreObject.h @@ -47,7 +47,7 @@ NSMutableArray *parentContainersBag; MAPIStoreObject *container; id sogoObject; - NSMutableDictionary *newProperties; + NSMutableDictionary *properties; BOOL isNew; } @@ -82,9 +82,9 @@ /* properties */ -- (void) addNewProperties: (NSDictionary *) newNewProperties; -- (NSDictionary *) newProperties; -- (void) resetNewProperties; +- (void) addProperties: (NSDictionary *) newProperties; +- (NSDictionary *) properties; +- (void) resetProperties; /* ops */ - (int) getAvailableProperties: (struct SPropTagArray **) propertiesP @@ -94,7 +94,7 @@ andCount: (uint16_t) columnCount inMemCtx: (TALLOC_CTX *) localMemCtx; -- (int) setProperties: (struct SRow *) aRow; +- (int) addPropertiesFromRow: (struct SRow *) aRow; - (int) getProperty: (void **) data withTag: (enum MAPITAGS) propTag diff --git a/OpenChange/MAPIStoreObject.m b/OpenChange/MAPIStoreObject.m index 24b3fee38..8b7212289 100644 --- a/OpenChange/MAPIStoreObject.m +++ b/OpenChange/MAPIStoreObject.m @@ -104,7 +104,7 @@ static Class NSExceptionK, MAPIStoreFolderK; parentContainersBag = [NSMutableArray new]; container = nil; sogoObject = nil; - newProperties = [NSMutableDictionary new]; + properties = [NSMutableDictionary new]; isNew = NO; } @@ -129,7 +129,7 @@ static Class NSExceptionK, MAPIStoreFolderK; { [self logWithFormat: @"-dealloc"]; [sogoObject release]; - [newProperties release]; + [properties release]; [parentContainersBag release]; [container release]; [super dealloc]; @@ -225,19 +225,19 @@ static Class NSExceptionK, MAPIStoreFolderK; return tz; } -- (void) addNewProperties: (NSDictionary *) newNewProperties +- (void) addProperties: (NSDictionary *) newNewProperties { - [newProperties addEntriesFromDictionary: newNewProperties]; + [properties addEntriesFromDictionary: newNewProperties]; } -- (NSDictionary *) newProperties +- (NSDictionary *) properties { - return newProperties; + return properties; } -- (void) resetNewProperties +- (void) resetProperties { - [newProperties removeAllObjects]; + [properties removeAllObjects]; } - (int) getProperty: (void **) data @@ -430,7 +430,7 @@ static Class NSExceptionK, MAPIStoreFolderK; return MAPISTORE_SUCCESS; } -- (int) setProperties: (struct SRow *) aRow +- (int) addPropertiesFromRow: (struct SRow *) aRow { struct SPropValue *cValue; NSUInteger counter; @@ -438,8 +438,8 @@ static Class NSExceptionK, MAPIStoreFolderK; for (counter = 0; counter < aRow->cValues; counter++) { cValue = aRow->lpProps + counter; - [newProperties setObject: NSObjectFromSPropValue (cValue) - forKey: MAPIPropertyKey (cValue->ulPropTag)]; + [properties setObject: NSObjectFromSPropValue (cValue) + forKey: MAPIPropertyKey (cValue->ulPropTag)]; } return MAPISTORE_SUCCESS; diff --git a/OpenChange/MAPIStoreSOGo.m b/OpenChange/MAPIStoreSOGo.m index 223e5f519..a3a9d5edd 100644 --- a/OpenChange/MAPIStoreSOGo.m +++ b/OpenChange/MAPIStoreSOGo.m @@ -1069,7 +1069,7 @@ sogo_properties_set_properties (void *object, struct SRow *aRow) wrapper = object; propObject = wrapper->MAPIStoreSOGoObject; pool = [NSAutoreleasePool new]; - rc = [propObject setProperties: aRow]; + rc = [propObject addPropertiesFromRow: aRow]; [pool release]; } else diff --git a/OpenChange/MAPIStoreTasksMessage.m b/OpenChange/MAPIStoreTasksMessage.m index dafebc41b..3dcc4b41d 100644 --- a/OpenChange/MAPIStoreTasksMessage.m +++ b/OpenChange/MAPIStoreTasksMessage.m @@ -313,29 +313,29 @@ [vCalendar setProdID: @"-//Inverse inc.//OpenChange+SOGo//EN"]; // summary - value = [newProperties + value = [properties objectForKey: MAPIPropertyKey (PR_NORMALIZED_SUBJECT_UNICODE)]; if (value) [vToDo setSummary: value]; // comment - value = [newProperties + value = [properties objectForKey: MAPIPropertyKey (PR_BODY_UNICODE)]; if (value) [vToDo setComment: value]; // location - value = [newProperties objectForKey: MAPIPropertyKey (PidLidLocation)]; + value = [properties objectForKey: MAPIPropertyKey (PidLidLocation)]; if (value) [vToDo setLocation: value]; // created - value = [newProperties objectForKey: MAPIPropertyKey (PR_CREATION_TIME)]; + value = [properties objectForKey: MAPIPropertyKey (PR_CREATION_TIME)]; if (value) [vToDo setCreated: value]; // last-modified + dtstamp - value = [newProperties objectForKey: MAPIPropertyKey (PR_LAST_MODIFICATION_TIME)]; + value = [properties objectForKey: MAPIPropertyKey (PR_LAST_MODIFICATION_TIME)]; if (value) { [vToDo setLastModified: value]; @@ -347,7 +347,7 @@ [vCalendar addTimeZone: tz]; // start - value = [newProperties objectForKey: MAPIPropertyKey (PidLidTaskStartDate)]; + value = [properties objectForKey: MAPIPropertyKey (PidLidTaskStartDate)]; if (value) { date = (iCalDateTime *) [vToDo uniqueChildWithTag: @"dtstart"]; @@ -360,7 +360,7 @@ } // due - value = [newProperties objectForKey: MAPIPropertyKey (PidLidTaskDueDate)]; + value = [properties objectForKey: MAPIPropertyKey (PidLidTaskDueDate)]; if (value) { date = (iCalDateTime *) [vToDo uniqueChildWithTag: @"due"]; @@ -373,7 +373,7 @@ } // completed - value = [newProperties objectForKey: MAPIPropertyKey (PidLidTaskDateCompleted)]; + value = [properties objectForKey: MAPIPropertyKey (PidLidTaskDateCompleted)]; if (value) { date = (iCalDateTime *) [vToDo uniqueChildWithTag: @"completed"]; @@ -386,7 +386,7 @@ } // status - value = [newProperties objectForKey: MAPIPropertyKey (PidLidTaskStatus)]; + value = [properties objectForKey: MAPIPropertyKey (PidLidTaskStatus)]; if (value) { switch ([value intValue]) @@ -399,7 +399,7 @@ } // priority - value = [newProperties objectForKey: MAPIPropertyKey (PR_IMPORTANCE)]; + value = [properties objectForKey: MAPIPropertyKey (PR_IMPORTANCE)]; if (value) { switch ([value intValue]) @@ -421,7 +421,7 @@ // percent complete // NOTE: this does not seem to work on Outlook 2003. PidLidPercentComplete's value // is always set to 0, no matter what value is set in Outlook - value = [newProperties objectForKey: MAPIPropertyKey(PidLidPercentComplete)]; + value = [properties objectForKey: MAPIPropertyKey(PidLidPercentComplete)]; if (value) [vToDo setPercentComplete: [value stringValue]]; @@ -434,7 +434,7 @@ [sogoObject saveContentString: [vCalendar versitString]]; [(MAPIStoreTasksFolder *) container synchroniseCache]; - value = [newProperties objectForKey: MAPIPropertyKey (PR_CHANGE_KEY)]; + value = [properties objectForKey: MAPIPropertyKey (PR_CHANGE_KEY)]; if (value) [(MAPIStoreTasksFolder *) container setChangeKey: value forMessageWithKey: [self nameInContainer]];