From 88a74bcb5cf5b89ce1778b0637786a1e0a7dbce0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Amor=20Garc=C3=ADa?= Date: Wed, 4 Nov 2015 13:08:53 +0100 Subject: [PATCH 1/2] Do not save IPM.DistList messages --- OpenChange/MAPIStoreContactsMessage.m | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/OpenChange/MAPIStoreContactsMessage.m b/OpenChange/MAPIStoreContactsMessage.m index cccb495e1..0236f1817 100644 --- a/OpenChange/MAPIStoreContactsMessage.m +++ b/OpenChange/MAPIStoreContactsMessage.m @@ -1024,10 +1024,12 @@ fromProperties: (NSDictionary *) attachmentProps || (!isNew && [roles containsObject: SOGoRole_ObjectEditor])); } -// -// -// -- (void) save:(TALLOC_CTX *) memCtx +- (void) saveDistList:(TALLOC_CTX *) memCtx +{ + [self warnWithFormat: @"IPM.DistList messages are ignored"]; +} + +- (void) saveContact:(TALLOC_CTX *) memCtx { NSArray *elements, *units; CardElement *element; @@ -1373,4 +1375,14 @@ fromProperties: (NSDictionary *) attachmentProps [self updateVersions]; } +- (void) save:(TALLOC_CTX *) memCtx +{ + NSString *messageClass = [properties objectForKey: MAPIPropertyKey(PR_MESSAGE_CLASS_UNICODE)]; + if ([messageClass isEqualToString: @"IPM.DistList"]) + [self saveDistList: memCtx]; + else + [self saveContact: memCtx]; +} + + @end From a73df96b78b5824a3fa81231f94b1c7125d6c1b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Amor=20Garc=C3=ADa?= Date: Mon, 16 Nov 2015 13:56:04 +0100 Subject: [PATCH 2/2] [MAPIStoreGCSMessage getPidTagChangeKey:inMemCtx:] return on error This method aborted when no PidTagChangeKey was found and the new flag was not set. Now it returns MAPISTORE_ERR_NOT_FOUND. --- OpenChange/MAPIStoreGCSMessage.m | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/OpenChange/MAPIStoreGCSMessage.m b/OpenChange/MAPIStoreGCSMessage.m index 747bb783a..f9d3a16d8 100644 --- a/OpenChange/MAPIStoreGCSMessage.m +++ b/OpenChange/MAPIStoreGCSMessage.m @@ -140,9 +140,16 @@ [parentFolder synchroniseCache]; changeKey = [parentFolder changeKeyForMessageWithKey: nameInContainer]; } - if (!changeKey) - abort (); - *data = [changeKey asBinaryInMemCtx: memCtx]; + if (changeKey) + *data = [changeKey asBinaryInMemCtx: memCtx]; + else + { + [self warnWithFormat: @"No change key for %@ in folder %@", + nameInContainer, + [parentFolder url] + ]; + rc = MAPISTORE_ERR_NOT_FOUND; + } } return rc;