mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-13 15:35:30 +00:00
Monotone-Parent: faa665d09f8735444e5cc6f1e0ca073851cbab3f
Monotone-Revision: d48fed214ae2d8c0aea1b8848de745e3ee235afa Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-11-07T15:07:37 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,3 +1,18 @@
|
||||
2011-11-07 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* OpenChange/MAPIStoreFolder.m (-addProperties:): we now override
|
||||
this method instead of -addPropertiesFromRow:. Also, invoking
|
||||
resetCache is no longer required since the "properties" ivar is
|
||||
no longer used in this class.
|
||||
|
||||
* OpenChange/MAPIStoreObject.m (-addPropertiesFromRow:): now
|
||||
invokes [self addProperties:] to modify the "properties" ivar,
|
||||
instead of doing it directly. This enables subclasses to only need
|
||||
overriding -addProperties:.
|
||||
|
||||
* OpenChange/MAPIStoreVolatileMessage.m (-addPropertiesFromRow:):
|
||||
removed obsolete overloading of method.
|
||||
|
||||
2011-11-02 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* OpenChange/MAPIStoreMessage.m (-setReadFlag:): make overrides
|
||||
|
||||
@@ -898,33 +898,28 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
|
||||
return rc;
|
||||
}
|
||||
|
||||
- (int) addPropertiesFromRow: (struct SRow *) aRow
|
||||
- (void) addProperties: (NSDictionary *) newProperties
|
||||
{
|
||||
static enum MAPITAGS bannedProps[] = { PR_MID, PR_FID, PR_PARENT_FID,
|
||||
PR_SOURCE_KEY, PR_PARENT_SOURCE_KEY,
|
||||
PR_CHANGE_KEY, 0x00000000 };
|
||||
enum MAPITAGS *currentProp;
|
||||
int rc;
|
||||
|
||||
rc = [super addPropertiesFromRow: aRow];
|
||||
NSMutableDictionary *propsCopy;
|
||||
|
||||
/* TODO: this should no longer be required once mapistore v2 API is in
|
||||
place, when we can then do this from -dealloc below */
|
||||
if ([properties count] > 0)
|
||||
{
|
||||
currentProp = bannedProps;
|
||||
while (*currentProp)
|
||||
{
|
||||
[properties removeObjectForKey: MAPIPropertyKey (*currentProp)];
|
||||
currentProp++;
|
||||
}
|
||||
|
||||
[propsMessage appendProperties: properties];
|
||||
[propsMessage save];
|
||||
[self resetProperties];
|
||||
propsCopy = [newProperties mutableCopy];
|
||||
currentProp = bannedProps;
|
||||
while (*currentProp)
|
||||
{
|
||||
[propsCopy removeObjectForKey: MAPIPropertyKey (*currentProp)];
|
||||
currentProp++;
|
||||
}
|
||||
|
||||
return rc;
|
||||
[propsMessage appendProperties: propsCopy];
|
||||
[propsMessage save];
|
||||
[propsCopy release];
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
|
||||
@@ -451,14 +451,18 @@ static Class NSExceptionK, MAPIStoreFolderK;
|
||||
{
|
||||
struct SPropValue *cValue;
|
||||
NSUInteger counter;
|
||||
NSMutableDictionary *newProperties;
|
||||
|
||||
newProperties = [NSMutableDictionary dictionaryWithCapacity: aRow->cValues];
|
||||
for (counter = 0; counter < aRow->cValues; counter++)
|
||||
{
|
||||
cValue = aRow->lpProps + counter;
|
||||
[properties setObject: NSObjectFromSPropValue (cValue)
|
||||
forKey: MAPIPropertyKey (cValue->ulPropTag)];
|
||||
[newProperties setObject: NSObjectFromSPropValue (cValue)
|
||||
forKey: MAPIPropertyKey (cValue->ulPropTag)];
|
||||
}
|
||||
|
||||
[self addProperties: newProperties];
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@@ -80,21 +80,6 @@ Class NSNumberK;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (int) addPropertiesFromRow: (struct SRow *) aRow
|
||||
{
|
||||
int rc;
|
||||
|
||||
rc = [super addPropertiesFromRow: aRow];
|
||||
if (rc == MAPISTORE_SUCCESS)
|
||||
{
|
||||
[sogoObject appendProperties: properties];
|
||||
[properties removeAllObjects];
|
||||
ASSIGN (lastModificationTime, [NSDate date]);
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
- (void) addProperties: (NSDictionary *) newProperties
|
||||
{
|
||||
[super addProperties: newProperties];
|
||||
|
||||
Reference in New Issue
Block a user