From 493a395c0a1f6afee26107dcfb4b9bca9ebf7619 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 30 Dec 2010 14:34:44 +0000 Subject: [PATCH] Monotone-Parent: 1cf0666c301d95bac897f1c057e68496cb752e24 Monotone-Revision: 02350430ab168e12b644600df191c30306030fe3 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-12-30T14:34:44 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 5 + OpenChange/MAPIStoreContactsContext.m | 356 ++------------------- OpenChange/MAPIStoreContactsMessageTable.h | 31 ++ OpenChange/MAPIStoreContactsMessageTable.m | 260 +++++++++++++++ 4 files changed, 318 insertions(+), 334 deletions(-) create mode 100644 OpenChange/MAPIStoreContactsMessageTable.h create mode 100644 OpenChange/MAPIStoreContactsMessageTable.m diff --git a/ChangeLog b/ChangeLog index 1e0c9c809..f39e71112 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2010-12-30 Wolfgang Sourdeau + * OpenChange/MAPIStoreContactsContext.m: Old table methods (see + below) split into the new "MAPIStoreContactsMessageTable" class. + (+registerFixedMappings:): changed handled uri to + @"sogo://openchange:openchange@contacts/". + * OpenChange/MAPIStoreTasksContext.m: Old table methods (see below) split into the new "MAPIStoreTasksMessageTable" class. (+registerFixedMappings:): changed handled uri to diff --git a/OpenChange/MAPIStoreContactsContext.m b/OpenChange/MAPIStoreContactsContext.m index b61b35189..63abb3031 100644 --- a/OpenChange/MAPIStoreContactsContext.m +++ b/OpenChange/MAPIStoreContactsContext.m @@ -20,31 +20,21 @@ * Boston, MA 02111-1307, USA. */ -#import +#import #import -#import - -#import - -#import -#import #import #import +#import #import "MAPIApplication.h" #import "MAPIStoreAuthenticator.h" +#import "MAPIStoreContactsMessageTable.h" #import "MAPIStoreMapping.h" -#import "MAPIStoreTypes.h" -#import "NSString+MAPIStore.h" -#import "SOGoGCSFolder+MAPIStore.h" #import "MAPIStoreContactsContext.h" -#undef DEBUG -#include - @implementation MAPIStoreContactsContext + (NSString *) MAPIModuleName @@ -54,354 +44,52 @@ + (void) registerFixedMappings: (MAPIStoreMapping *) mapping { - [mapping registerURL: @"sogo://openchange:openchange@contacts/personal/" + [mapping registerURL: @"sogo://openchange:openchange@contacts/" withID: 0x1a0001]; } - (void) setupModuleFolder { - id userFolder; + SOGoUserFolder *userFolder; + SOGoContactFolders *parentFolder; userFolder = [SOGoUserFolder objectWithName: [authenticator username] inContainer: MAPIApp]; [parentFoldersBag addObject: userFolder]; [woContext setClientObject: userFolder]; - moduleFolder = [userFolder lookupName: @"Contacts" - inContext: woContext - acquire: NO]; + parentFolder = [userFolder lookupName: @"Contacts" + inContext: woContext + acquire: NO]; + [parentFoldersBag addObject: parentFolder]; + [woContext setClientObject: parentFolder]; + + moduleFolder = [parentFolder lookupName: @"personal" + inContext: woContext + acquire: NO]; [moduleFolder retain]; } - -- (NSArray *) getFolderMessageKeys: (SOGoFolder *) folder - matchingQualifier: (EOQualifier *) qualifier +- (Class) messageTableClass { - EOQualifier *componentQualifier, *contactsQualifier; - - /* TODO: we need to support vlist as well */ - componentQualifier - = [[EOKeyValueQualifier alloc] initWithKey: @"c_component" - operatorSelector: EOQualifierOperatorEqual - value: @"vcard"]; - [componentQualifier autorelease]; - if (qualifier) - { - contactsQualifier = [[EOAndQualifier alloc] - initWithQualifiers: - componentQualifier, - qualifier, - nil]; - [contactsQualifier autorelease]; - } - else - contactsQualifier = componentQualifier; - - return [super getFolderMessageKeys: folder - matchingQualifier: contactsQualifier]; + return [MAPIStoreContactsMessageTable class]; } -// - (enum MAPISTATUS) getCommonTableChildproperty: (void **) data -// atURL: (NSString *) childURL -// withTag: (enum MAPITAGS) proptag -// inFolder: (SOGoFolder *) folder -// withFID: (uint64_t) fid -// { -// int rc; - -// rc = MAPI_E_SUCCESS; -// switch (proptag) { -// default: -// rc = [super getCommonTableChildproperty: data -// atURL: childURL -// withTag: proptag -// inFolder: folder -// withFID: fid]; -// } - -// return rc; -// } - -- (NSString *) _phoneOfType: (NSString *) aType - excluding: (NSString *) aTypeToExclude - inCard: (NGVCard *) card -{ - NSArray *elements; - NSArray *phones; - NSString *phone; - - phones = [card childrenWithTag: @"tel"]; - - elements = [phones cardElementsWithAttribute: @"type" - havingValue: aType]; - - phone = nil; - - if ([elements count] > 0) - { - CardElement *ce; - int i; - - for (i = 0; i < [elements count]; i++) - { - ce = [elements objectAtIndex: i]; - phone = [ce value: 0]; - - if (!aTypeToExclude) - break; - - if (![ce hasAttribute: @"type" havingValue: aTypeToExclude]) - break; - - phone = nil; - } - } - - if (!phone) - phone = @""; - - return phone; -} - -- (enum MAPISTATUS) getMessageTableChildproperty: (void **) data - atURL: (NSString *) childURL - withTag: (enum MAPITAGS) proptag - inFolder: (SOGoFolder *) folder - withFID: (uint64_t) fid -{ - NSString *stringValue; - id child; - enum MAPISTATUS rc; - - rc = MAPI_E_SUCCESS; - switch (proptag) - { - case PR_ICON_INDEX: // TODO - /* see http://msdn.microsoft.com/en-us/library/cc815472.aspx */ - *data = MAPILongValue (memCtx, 0x00000200); - break; - case PR_MESSAGE_CLASS_UNICODE: - *data = talloc_strdup (memCtx, "IPM.Contact"); - break; - // case PR_VD_NAME_UNICODE: - // *data = talloc_strdup (memCtx, "PR_VD_NAME_UNICODE"); - // break; - // case PR_EMS_AB_DXA_REMOTE_CLIENT_UNICODE: "Home:" ??? - // *data = talloc_strdup (memCtx, "PR_EMS..."); - // break; - case PR_SUBJECT_UNICODE: - *data = talloc_strdup (memCtx, "PR_SUBJECT..."); - break; - case PR_OAB_NAME_UNICODE: - *data = talloc_strdup (memCtx, "PR_OAB_NAME_UNICODE"); - break; - case PR_OAB_LANGID: - /* see http://msdn.microsoft.com/en-us/goglobal/bb895996.asxp */ - /* English US */ - *data = MAPILongValue (memCtx, 0x0409); - break; - - case PR_TITLE_UNICODE: - child = [self lookupObject: childURL]; - stringValue = [[child vCard] title]; - *data = [stringValue asUnicodeInMemCtx: memCtx]; - break; - - case PR_COMPANY_NAME_UNICODE: - child = [self lookupObject: childURL]; - /* that's buggy but it's for the demo */ - stringValue = [[[child vCard] org] componentsJoinedByString: @", "]; - *data = [stringValue asUnicodeInMemCtx: memCtx]; - break; - - case PR_DISPLAY_NAME_UNICODE: // Full Name - case 0x81c2001f: // contact block title name - rc = [super getMessageTableChildproperty: data - atURL: childURL - withTag: PR_DISPLAY_NAME_UNICODE - inFolder: folder - withFID: fid]; - break; - case 0x81b0001f: // E-mail - child = [self lookupObject: childURL]; - stringValue = [[child vCard] preferredEMail]; - *data = [stringValue asUnicodeInMemCtx: memCtx]; - break; - case PR_BODY_UNICODE: - child = [self lookupObject: childURL]; - stringValue = [[child vCard] note]; - *data = [stringValue asUnicodeInMemCtx: memCtx]; - break; - - case PR_OFFICE_TELEPHONE_NUMBER_UNICODE: - child = [self lookupObject: childURL]; - stringValue = [self _phoneOfType: @"work" - excluding: @"fax" - inCard: [child vCard]]; - *data = [stringValue asUnicodeInMemCtx: memCtx]; - break; - case PR_HOME_TELEPHONE_NUMBER_UNICODE: - child = [self lookupObject: childURL]; - stringValue = [self _phoneOfType: @"home" - excluding: @"fax" - inCard: [child vCard]]; - *data = [stringValue asUnicodeInMemCtx: memCtx]; - break; - case PR_MOBILE_TELEPHONE_NUMBER_UNICODE: - child = [self lookupObject: childURL]; - stringValue = [self _phoneOfType: @"cell" - excluding: nil - inCard: [child vCard]]; - *data = [stringValue asUnicodeInMemCtx: memCtx]; - break; - case PR_PRIMARY_TELEPHONE_NUMBER_UNICODE: - child = [self lookupObject: childURL]; - stringValue = [self _phoneOfType: @"pref" - excluding: nil - inCard: [child vCard]]; - *data = [stringValue asUnicodeInMemCtx: memCtx]; - break; - - // case 0x81ad001f: /* PidLidEmail1AddressType */ - // case 0x81b2001f: /* PidLidEmail2AddressType */ - // case 0x81b7001f: /* PidLidEmail3AddressType */ - // *data = [@"SMTP" asUnicodeInMemCtx: memCtx]; - // break; - - // case PR_POSTAL_ADDRESS_UNICODE: - // case PR_INTERNET_MESSAGE_ID_UNICODE: - // case PR_CAR_TELEPHONE_NUMBER_UNICODE: - // case PR_OTHER_TELEPHONE_NUMBER_UNICODE: - // case PR_BUSINESS_FAX_NUMBER_UNICODE: - // case PR_HOME_FAX_NUMBER_UNICODE: - // case PR_COMPANY_MAIN_PHONE_NUMBER_UNICODE: - // case PR_EMS_AB_GROUP_BY_ATTR_4_UNICODE: - // case PR_CALLBACK_TELEPHONE_NUMBER_UNICODE: - // case PR_DEPARTMENT_NAME_UNICODE: - // case PR_OFFICE2_TELEPHONE_NUMBER_UNICODE: - // case PR_RADIO_TELEPHONE_NUMBER_UNICODE: - // case PR_PAGER_TELEPHONE_NUMBER_UNICODE: - // case PR_PRIMARY_FAX_NUMBER_UNICODE: - // case PR_TELEX_NUMBER_UNICODE: - // case PR_ISDN_NUMBER_UNICODE: - // case PR_ASSISTANT_TELEPHONE_NUMBER_UNICODE: - // case PR_HOME2_TELEPHONE_NUMBER_UNICODE: - // case PR_TTYTDD_PHONE_NUMBER_UNICODE: - // case PR_BUSINESS_HOME_PAGE_UNICODE: - // *data = talloc_strdup (memCtx, "[Generic and fake unicode value]"); - // break; - - // (18:54:45) Wolfgang-: 0x80a7001f ( Business: ) -> don't ask me which "business" - // (18:55:05) Wolfgang-: 0x809c001f ( Other: ) - // (18:55:58) Wolfgang-: 0x81b5001f: E-mail 2 - - - // #define PR_REPLY_TIME PROP_TAG(PT_SYSTIME , 0x0030) /* 0x00300040 */ - // #define PR_SENSITIVITY PROP_TAG(PT_LONG , 0x0036) /* 0x00360003 */ - // #define PR_FOLLOWUP_ICON PROP_TAG(PT_LONG , 0x1095) /* 0x10950003 */ - // #define PR_SEARCH_KEY PROP_TAG(PT_BINARY , 0x300b) /* 0x300b0102 */ - // #define PR_VIEW_STYLE PROP_TAG(PT_LONG , 0x6834) /* 0x68340003 */ - // #define PR_VD_VERSION PROP_TAG(PT_LONG , 0x7007) /* 0x70070003 */ - - default: - rc = [super getMessageTableChildproperty: data - atURL: childURL - withTag: proptag - inFolder: folder - withFID: fid]; - } - - return rc; -} - -- (id) createMessageInFolder: (id) parentFolder +- (id) createMessageOfClass: (NSString *) messageClass + inFolderAtURL: (NSString *) folderURL; { + SOGoContactGCSFolder *parentFolder; SOGoContactGCSEntry *newEntry; NSString *name; + parentFolder = [self lookupObject: folderURL]; name = [NSString stringWithFormat: @"%@.vcf", [SOGoObject globallyUniqueObjectId]]; newEntry = [SOGoContactGCSEntry objectWithName: name - inContainer: parentFolder]; + inContainer: parentFolder]; [newEntry setIsNew: YES]; return newEntry; } -// - (enum MAPISTATUS) getFolderTableChildproperty: (void **) data -// atURL: (NSString *) childURL -// withTag: (enum MAPITAGS) proptag -// inFolder: (SOGoFolder *) folder -// withFID: (uint64_t) fid -// { -// int rc; - -// [self logWithFormat: @"XXXXX unexpected!!!!!!!!!"]; -// rc = MAPI_E_SUCCESS; -// switch (proptag) -// { -// default: -// rc = [super getFolderTableChildproperty: data -// atURL: childURL -// withTag: proptag -// inFolder: folder -// withFID: fid]; -// } - -// return rc; -// } - -- (NSString *) backendIdentifierForProperty: (enum MAPITAGS) property -{ - static NSMutableDictionary *knownProperties = nil; - - if (!knownProperties) - { - knownProperties = [NSMutableDictionary new]; - [knownProperties setObject: @"c_mail" - forKey: MAPIPropertyKey (0x81ae001f)]; - [knownProperties setObject: @"c_mail" - forKey: MAPIPropertyKey (0x81b3001f)]; - [knownProperties setObject: @"c_mail" - forKey: MAPIPropertyKey (PR_EMS_AB_GROUP_BY_ATTR_2_UNICODE)]; - [knownProperties setObject: @"c_cn" - forKey: MAPIPropertyKey (PR_DISPLAY_NAME_UNICODE)]; - } - - return [knownProperties objectForKey: MAPIPropertyKey (property)]; -} - -/* restrictions */ - -- (MAPIRestrictionState) evaluatePropertyRestriction: (struct mapi_SPropertyRestriction *) res - intoQualifier: (EOQualifier **) qualifier -{ - MAPIRestrictionState rc; - id value; - - value = NSObjectFromMAPISPropValue (&res->lpProp); - switch (res->ulPropTag) - { - case PR_MESSAGE_CLASS_UNICODE: - if ([value isEqualToString: @"IPM.Contact"]) - rc = MAPIRestrictionStateAlwaysTrue; - else - rc = MAPIRestrictionStateAlwaysFalse; - break; - case PR_EMS_AB_RAS_ACCOUNT_UNICODE: - case 0x81b2001f: - case PR_EMS_AB_GROUP_BY_ATTR_1_UNICODE: - if ([value isEqualToString: @"SMTP"]) - rc = MAPIRestrictionStateAlwaysTrue; - else - rc = MAPIRestrictionStateAlwaysFalse; - break; - - default: - rc = [super evaluatePropertyRestriction: res intoQualifier: qualifier]; - } - - return rc; -} - @end diff --git a/OpenChange/MAPIStoreContactsMessageTable.h b/OpenChange/MAPIStoreContactsMessageTable.h new file mode 100644 index 000000000..56a317cb0 --- /dev/null +++ b/OpenChange/MAPIStoreContactsMessageTable.h @@ -0,0 +1,31 @@ +/* MAPIStoreContactsMessageTable.h - this file is part of SOGo + * + * Copyright (C) 2010 Inverse inc + * + * Author: Wolfgang Sourdeau + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef MAPISTORECONTACTSMESSAGETABLE_H +#define MAPISTORECONTACTSMESSAGETABLE_H + +#import "MAPIStoreGCSMessageTable.h" + +@interface MAPIStoreContactsMessageTable : MAPIStoreGCSMessageTable +@end + +#endif /* MAPISTORECONTACTSMESSAGETABLE_H */ diff --git a/OpenChange/MAPIStoreContactsMessageTable.m b/OpenChange/MAPIStoreContactsMessageTable.m new file mode 100644 index 000000000..bc9f0ec84 --- /dev/null +++ b/OpenChange/MAPIStoreContactsMessageTable.m @@ -0,0 +1,260 @@ +/* MAPIStoreContactsMessageTable.m - this file is part of SOGo + * + * Copyright (C) 2010 Inverse inc + * + * Author: Wolfgang Sourdeau + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#import +#import + +#import + +#import +#import + +#import + +#import "MAPIStoreTypes.h" +#import "NSString+MAPIStore.h" + +#import "MAPIStoreContactsMessageTable.h" + +#include + +@implementation MAPIStoreContactsMessageTable + +- (EOQualifier *) componentQualifier +{ + static EOQualifier *componentQualifier = nil; + + /* TODO: we need to support vlist as well */ + if (!componentQualifier) + componentQualifier + = [[EOKeyValueQualifier alloc] initWithKey: @"c_component" + operatorSelector: EOQualifierOperatorEqual + value: @"vcard"]; + + return componentQualifier; +} + +- (NSString *) _phoneOfType: (NSString *) aType + excluding: (NSString *) aTypeToExclude + inCard: (NGVCard *) card +{ + NSArray *elements; + NSArray *phones; + NSString *phone; + + phones = [card childrenWithTag: @"tel"]; + + elements = [phones cardElementsWithAttribute: @"type" + havingValue: aType]; + + phone = nil; + + if ([elements count] > 0) + { + CardElement *ce; + int i; + + for (i = 0; i < [elements count]; i++) + { + ce = [elements objectAtIndex: i]; + phone = [ce value: 0]; + + if (!aTypeToExclude) + break; + + if (![ce hasAttribute: @"type" havingValue: aTypeToExclude]) + break; + + phone = nil; + } + } + + if (!phone) + phone = @""; + + return phone; +} + +- (enum MAPISTATUS) getChildProperty: (void **) data + forKey: (NSString *) childKey + withTag: (enum MAPITAGS) proptag +{ + NSString *stringValue; + SOGoContactGCSEntry *child; + enum MAPISTATUS rc; + + rc = MAPI_E_SUCCESS; + switch (proptag) + { + case PR_ICON_INDEX: // TODO + /* see http://msdn.microsoft.com/en-us/library/cc815472.aspx */ + *data = MAPILongValue (memCtx, 0x00000200); + break; + case PR_MESSAGE_CLASS_UNICODE: + *data = talloc_strdup (memCtx, "IPM.Contact"); + break; + // case PR_VD_NAME_UNICODE: + // *data = talloc_strdup (memCtx, "PR_VD_NAME_UNICODE"); + // break; + // case PR_EMS_AB_DXA_REMOTE_CLIENT_UNICODE: "Home:" ??? + // *data = talloc_strdup (memCtx, "PR_EMS..."); + // break; + case PR_SUBJECT_UNICODE: + *data = talloc_strdup (memCtx, "PR_SUBJECT..."); + break; + case PR_OAB_NAME_UNICODE: + *data = talloc_strdup (memCtx, "PR_OAB_NAME_UNICODE"); + break; + case PR_OAB_LANGID: + /* see http://msdn.microsoft.com/en-us/goglobal/bb895996.asxp */ + /* English US */ + *data = MAPILongValue (memCtx, 0x0409); + break; + + case PR_TITLE_UNICODE: + child = [self lookupChild: childKey]; + stringValue = [[child vCard] title]; + *data = [stringValue asUnicodeInMemCtx: memCtx]; + break; + + case PR_COMPANY_NAME_UNICODE: + child = [self lookupChild: childKey]; + /* that's buggy but it's for the demo */ + stringValue = [[[child vCard] org] componentsJoinedByString: @", "]; + *data = [stringValue asUnicodeInMemCtx: memCtx]; + break; + + case PR_DISPLAY_NAME_UNICODE: // Full Name + case PidLidFileUnder: // contact block title name + rc = [super getChildProperty: data + forKey: childKey + withTag: PR_DISPLAY_NAME_UNICODE]; + break; + case PidLidEmail1OriginalDisplayName: // E-mail + child = [self lookupChild: childKey]; + stringValue = [[child vCard] preferredEMail]; + *data = [stringValue asUnicodeInMemCtx: memCtx]; + break; + case PR_BODY_UNICODE: + child = [self lookupChild: childKey]; + stringValue = [[child vCard] note]; + *data = [stringValue asUnicodeInMemCtx: memCtx]; + break; + + case PR_OFFICE_TELEPHONE_NUMBER_UNICODE: + child = [self lookupChild: childKey]; + stringValue = [self _phoneOfType: @"work" + excluding: @"fax" + inCard: [child vCard]]; + *data = [stringValue asUnicodeInMemCtx: memCtx]; + break; + case PR_HOME_TELEPHONE_NUMBER_UNICODE: + child = [self lookupChild: childKey]; + stringValue = [self _phoneOfType: @"home" + excluding: @"fax" + inCard: [child vCard]]; + *data = [stringValue asUnicodeInMemCtx: memCtx]; + break; + case PR_MOBILE_TELEPHONE_NUMBER_UNICODE: + child = [self lookupChild: childKey]; + stringValue = [self _phoneOfType: @"cell" + excluding: nil + inCard: [child vCard]]; + *data = [stringValue asUnicodeInMemCtx: memCtx]; + break; + case PR_PRIMARY_TELEPHONE_NUMBER_UNICODE: + child = [self lookupChild: childKey]; + stringValue = [self _phoneOfType: @"pref" + excluding: nil + inCard: [child vCard]]; + *data = [stringValue asUnicodeInMemCtx: memCtx]; + break; + + case PidLidEmail1AddressType: + case PidLidEmail2AddressType: + case PidLidEmail3AddressType: + *data = [@"SMTP" asUnicodeInMemCtx: memCtx]; + break; + + default: + rc = [super getChildProperty: data + forKey: childKey + withTag: proptag]; + } + + return rc; +} + +- (NSString *) backendIdentifierForProperty: (enum MAPITAGS) property +{ + static NSMutableDictionary *knownProperties = nil; + + if (!knownProperties) + { + knownProperties = [NSMutableDictionary new]; + [knownProperties setObject: @"c_mail" + forKey: MAPIPropertyKey (PidLidEmail1EmailAddress)]; + [knownProperties setObject: @"c_mail" + forKey: MAPIPropertyKey (PidLidEmail2EmailAddress)]; + [knownProperties setObject: @"c_mail" + forKey: MAPIPropertyKey (PidLidEmail3EmailAddress)]; + [knownProperties setObject: @"c_cn" + forKey: MAPIPropertyKey (PR_DISPLAY_NAME_UNICODE)]; + } + + return [knownProperties objectForKey: MAPIPropertyKey (property)]; +} + +/* restrictions */ + +- (MAPIRestrictionState) evaluatePropertyRestriction: (struct mapi_SPropertyRestriction *) res + intoQualifier: (EOQualifier **) qualifier +{ + MAPIRestrictionState rc; + id value; + + value = NSObjectFromMAPISPropValue (&res->lpProp); + switch (res->ulPropTag) + { + case PR_MESSAGE_CLASS_UNICODE: + if ([value isEqualToString: @"IPM.Contact"]) + rc = MAPIRestrictionStateAlwaysTrue; + else + rc = MAPIRestrictionStateAlwaysFalse; + break; + case PidLidEmail1AddressType: + case PidLidEmail2AddressType: + case PidLidEmail3AddressType: + if ([value isEqualToString: @"SMTP"]) + rc = MAPIRestrictionStateAlwaysTrue; + else + rc = MAPIRestrictionStateAlwaysFalse; + break; + + default: + rc = [super evaluatePropertyRestriction: res intoQualifier: qualifier]; + } + + return rc; +} + +@end