From 5b77c2b7246fa584e7e81a151270a155e0a0bf39 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Thu, 19 Sep 2013 10:49:42 -0400 Subject: [PATCH] Stability fix when we're untable to determine the message class type --- OpenChange/MAPIStoreDBMessage.m | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/OpenChange/MAPIStoreDBMessage.m b/OpenChange/MAPIStoreDBMessage.m index 997f46570..074c205ea 100644 --- a/OpenChange/MAPIStoreDBMessage.m +++ b/OpenChange/MAPIStoreDBMessage.m @@ -23,6 +23,7 @@ #import #import #import +#import #import #import @@ -34,6 +35,7 @@ #import "MAPIStoreDBMessage.h" #import "MAPIStoreTypes.h" #import "NSObject+MAPIStore.h" +#import "NSString+MAPIStore.h" #undef DEBUG #include @@ -99,6 +101,21 @@ return objectVersion; } +// +// FIXME: how this can happen? +// +// We might get there if for some reasons, all classes weren't able +// to tell us the message class. +// +- (int) getPidTagMessageClass: (void **) data inMemCtx: (TALLOC_CTX *) memCtx +{ + *data = [@"IPM.Note" asUnicodeInMemCtx: memCtx]; + + [self logWithFormat: @"METHOD '%s' - unable to determine message class. Falling back to IPM.Note", __FUNCTION__]; + + return MAPISTORE_SUCCESS; +} + - (int) getProperties: (struct mapistore_property_data *) data withTags: (enum MAPITAGS *) tags andCount: (uint16_t) columnCount