Merge pull request #205 from zentyal/jag/dont-sync-contact-group-from-sogo

Do not save IPM.DistList messages
This commit is contained in:
Enrique J. Hernández 2015-11-19 10:39:59 +01:00
commit 0622980f38
2 changed files with 26 additions and 7 deletions

View file

@ -1024,10 +1024,12 @@ fromProperties: (NSDictionary *) attachmentProps
|| (!isNew && [roles containsObject: SOGoRole_ObjectEditor])); || (!isNew && [roles containsObject: SOGoRole_ObjectEditor]));
} }
// - (void) saveDistList:(TALLOC_CTX *) memCtx
// {
// [self warnWithFormat: @"IPM.DistList messages are ignored"];
- (void) save:(TALLOC_CTX *) memCtx }
- (void) saveContact:(TALLOC_CTX *) memCtx
{ {
NSArray *elements, *units; NSArray *elements, *units;
CardElement *element; CardElement *element;
@ -1373,4 +1375,14 @@ fromProperties: (NSDictionary *) attachmentProps
[self updateVersions]; [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 @end

View file

@ -140,9 +140,16 @@
[parentFolder synchroniseCache]; [parentFolder synchroniseCache];
changeKey = [parentFolder changeKeyForMessageWithKey: nameInContainer]; changeKey = [parentFolder changeKeyForMessageWithKey: nameInContainer];
} }
if (!changeKey) if (changeKey)
abort (); *data = [changeKey asBinaryInMemCtx: memCtx];
*data = [changeKey asBinaryInMemCtx: memCtx]; else
{
[self warnWithFormat: @"No change key for %@ in folder %@",
nameInContainer,
[parentFolder url]
];
rc = MAPISTORE_ERR_NOT_FOUND;
}
} }
return rc; return rc;