From 72fb3f552d38162562c3fe9a84e2a401cb321318 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 19 Sep 2012 12:25:20 -0400 Subject: [PATCH] PidTagBody: do not return a body if it is an empty string or a simple crlf --- OpenChange/MAPIStoreAppointmentWrapper.m | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/OpenChange/MAPIStoreAppointmentWrapper.m b/OpenChange/MAPIStoreAppointmentWrapper.m index 60e3068ba..9feaf7a1d 100644 --- a/OpenChange/MAPIStoreAppointmentWrapper.m +++ b/OpenChange/MAPIStoreAppointmentWrapper.m @@ -1217,15 +1217,20 @@ static NSCharacterSet *hexCharacterSet = nil; - (int) getPidTagBody: (void **) data inMemCtx: (TALLOC_CTX *) memCtx { - int rc = MAPISTORE_SUCCESS; + int rc; NSString *stringValue; /* FIXME: there is a confusion in NGCards around "comment" and "description" */ stringValue = [event comment]; - if ([stringValue length] > 0) - *data = [stringValue asUnicodeInMemCtx: memCtx]; + if ([stringValue length] > 0 + && ![stringValue isEqualToString: @"\r\n"] + && ![stringValue isEqualToString: @"\n"]) + { + rc = MAPISTORE_SUCCESS; + *data = [stringValue asUnicodeInMemCtx: memCtx]; + } else - *data = [@"" asUnicodeInMemCtx: memCtx]; + rc = MAPISTORE_ERR_NOT_FOUND; return rc; }