From 91fe9abd50ddbd3b9d057e002f13839f20672aaa Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 11 Jan 2011 23:07:41 +0000 Subject: [PATCH] Monotone-Parent: b917b1533c38a1f8ebf599d2f181801de2e29599 Monotone-Revision: 387d4024d17f365f108803c45c8199af49497950 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-01-11T23:07:41 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 6 +++++- OpenChange/MAPIStoreContext.m | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5ff9c0b4a..8407cb06d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,11 +1,15 @@ 2011-01-11 Ludovic Marcotte * OpenChange/MAPIStoreContactsMessageTable.m - Added more properties: home/work URL, nickname + Added more properties: home/work URL, nickname and department. 2011-01-11 Wolfgang Sourdeau + * OpenChange/MAPIStoreContext.m (-openMessage:withMID:inFID:): + create a message dictionary in the message cache in order to + enable modifications. + * OpenChange/MAPIStoreContactsMessageTable.m (-_element:ofType:excluding:inCard:): new version of the previous -_phoneOfType:excluding:inCard: method, which now returns the diff --git a/OpenChange/MAPIStoreContext.m b/OpenChange/MAPIStoreContext.m index 499758b67..29ff9e372 100644 --- a/OpenChange/MAPIStoreContext.m +++ b/OpenChange/MAPIStoreContext.m @@ -824,6 +824,7 @@ _prepareContextClass (struct mapistore_context *newMemCtx, NSString *childURL, *childKey, *folderURL; MAPIStoreTable *table; int rc; + BOOL isAssociated; childURL = [mapping urlFromID: mid]; if (childURL) @@ -832,9 +833,13 @@ _prepareContextClass (struct mapistore_context *newMemCtx, andFolderURLAt: &folderURL]; table = [self _tableForFID: fid andTableType: MAPISTORE_FAI_TABLE]; if ([[table cachedChildKeys] containsObject: childKey]) - rc = [self openMessage: msg forKey: childKey inTable: table]; + { + isAssociated = YES; + rc = [self openMessage: msg forKey: childKey inTable: table]; + } else { + isAssociated = NO; table = [self _tableForFID: fid andTableType: MAPISTORE_MESSAGE_TABLE]; if ([[table cachedChildKeys] containsObject: childKey]) rc = [self openMessage: msg forKey: childKey inTable: table]; @@ -845,6 +850,11 @@ _prepareContextClass (struct mapistore_context *newMemCtx, else rc = MAPISTORE_ERR_NOT_FOUND; + if (rc == MAPI_E_SUCCESS) + [self createMessagePropertiesWithMID: mid + inFID: fid + isAssociated: isAssociated]; + return rc; } @@ -1168,7 +1178,7 @@ _prepareContextClass (struct mapistore_context *newMemCtx, [self logWithFormat: @"fmid 0x%.16x found", fmid]; for (counter = 0; counter < aRow->cValues; counter++) { - cValue = &(aRow->lpProps[counter]); + cValue = aRow->lpProps + counter; [message setObject: NSObjectFromSPropValue (cValue) forKey: MAPIPropertyKey (cValue->ulPropTag)]; }