Monotone-Parent: bb660a831898726081ef797a1c2e73f2306dc626

Monotone-Revision: 2ba6874cdb3084059ed1f87ba96e55335c0a6a64

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2011-02-07T23:19:02
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2011-02-07 23:19:02 +00:00
parent d6e60a9ba7
commit 53a2c5538a
6 changed files with 61 additions and 15 deletions

View File

@ -1,5 +1,16 @@
2011-02-07 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* OpenChange/MAPIStoreMailMessageTable.m
(-getChildProperty:forKey:withTag:): return a proper value for
PR_SUBJECT_PREFIX_UNICODE and PR_NORMALIZED_SUBJECT_UNICODE.
* OpenChange/MAPIStoreMessageTable.m
(-getChildProperty:forKey:withTag:): now return standard values
(checked against doc) for PR_ORIGINAL_SUBJECT_UNICODE,
PR_CONVERSATION_TOPIC_UNICODE, PR_SUBJECT_PREFIX_UNICODE and
PR_NORMALIZED_SUBJECT_UNICODE, the two latter being common to all
modules except MAPIStoreMailMessageTable.
* OpenChange/MAPIStoreContext.m (-openMessage:forKey:inTable:):
only return PR_SUBJECT_PREFIX_UNICODE,
PR_NORMALIZED_SUBJECT_UNICODE as those are the only fields

View File

@ -102,8 +102,6 @@
// *data = MAPILongValue (memCtx, 0);
// break;
case PR_SUBJECT_UNICODE: // SUMMARY
case PR_NORMALIZED_SUBJECT_UNICODE:
case PR_CONVERSATION_TOPIC_UNICODE:
event = [[self lookupChild: childKey] component: NO secure: NO];
*data = [[event summary] asUnicodeInMemCtx: memCtx];
break;

View File

@ -145,8 +145,8 @@
case PR_DISPLAY_NAME_UNICODE: // Full Name
case PidLidFileUnder: // contact block title name
rc = [super getChildProperty: data
forKey: childKey
withTag: PR_DISPLAY_NAME_UNICODE];
forKey: childKey
withTag: PR_DISPLAY_NAME_UNICODE];
break;
case PidLidEmail1OriginalDisplayName: // E-mail
child = [self lookupChild: childKey];

View File

@ -118,7 +118,8 @@ static EOQualifier *nonDeletedQualifier = nil;
withTag: (enum MAPITAGS) propTag
{
SOGoMailObject *child;
NSString *childURL, *stringValue;
NSString *childURL, *subject, *stringValue;
NSInteger colIdx;
enum MAPISTATUS rc;
rc = MAPI_E_SUCCESS;
@ -128,9 +129,6 @@ static EOQualifier *nonDeletedQualifier = nil;
/* read mail, see http://msdn.microsoft.com/en-us/library/cc815472.aspx */
*data = MAPILongValue (memCtx, 0x00000100);
break;
case PR_CONVERSATION_TOPIC:
case PR_CONVERSATION_TOPIC_UNICODE:
case PR_SUBJECT:
case PR_SUBJECT_UNICODE:
child = [self lookupChild: childKey];
stringValue = [child decodedSubject];
@ -138,6 +136,33 @@ static EOQualifier *nonDeletedQualifier = nil;
stringValue = @"";
*data = [stringValue asUnicodeInMemCtx: memCtx];
break;
case PR_SUBJECT_PREFIX_UNICODE:
child = [self lookupChild: childKey];
subject = [child decodedSubject];
colIdx = [subject rangeOfString: @":"].location;
if (colIdx != NSNotFound && colIdx < 4)
stringValue = [NSString stringWithFormat: @"%@: ",
[subject substringToIndex: colIdx]];
else
stringValue = @"";
[self logWithFormat: @"subject prefix: %@", stringValue];
*data = [stringValue asUnicodeInMemCtx: memCtx];
break;
case PR_NORMALIZED_SUBJECT_UNICODE:
child = [self lookupChild: childKey];
subject = [child decodedSubject];
colIdx = [subject rangeOfString: @":"].location;
if (colIdx != NSNotFound && colIdx < 4)
stringValue = [[subject substringFromIndex: colIdx + 1]
stringByTrimmingLeadSpaces];
else
stringValue = subject;
if (!stringValue)
stringValue = @"";
[self logWithFormat: @"normalized subject: %@", stringValue];
*data = [stringValue asUnicodeInMemCtx: memCtx];
break;
case PR_MESSAGE_CLASS_UNICODE:
case PR_ORIG_MESSAGE_CLASS_UNICODE:
*data = talloc_strdup (memCtx, "IPM.Note");
@ -246,6 +271,9 @@ static EOQualifier *nonDeletedQualifier = nil;
/* TODO: the following are supposed to be display names, separated by a semicolumn */
case PR_RECEIVED_BY_NAME:
case PR_RECEIVED_BY_NAME_UNICODE:
case PR_RCVD_REPRESENTING_NAME:
case PR_RCVD_REPRESENTING_NAME_UNICODE:
case PR_DISPLAY_TO:
case PR_DISPLAY_TO_UNICODE:
case PR_ORIGINAL_DISPLAY_TO_UNICODE:
@ -414,6 +442,7 @@ static EOQualifier *nonDeletedQualifier = nil;
*data = [[child messageId] asUnicodeInMemCtx: memCtx];
break;
case PR_READ_RECEIPT_REQUESTED: // TODO
case PR_DELETE_AFTER_SUBMIT: // TODO
*data = MAPIBoolValue (memCtx, NO);
break;
case PidLidPrivate:

View File

@ -156,9 +156,6 @@ static MAPIStoreMapping *mapping;
case PR_MSG_STATUS: // TODO
*data = MAPILongValue (memCtx, 0);
break;
case PR_SUBJECT_PREFIX_UNICODE: // TODO
*data = [@"" asUnicodeInMemCtx: memCtx];
break;
case PR_IMPORTANCE: // TODO -> subclass?
*data = MAPILongValue (memCtx, 1);
break;
@ -186,9 +183,22 @@ static MAPIStoreMapping *mapping;
asShortBinaryInMemCtx: memCtx];
break;
case PR_SUBJECT_UNICODE:
rc = [self getChildProperty: data forKey: childKey
withTag: PR_NORMALIZED_SUBJECT_UNICODE];
withTag: PR_SUBJECT_UNICODE];
break;
case PR_ORIGINAL_SUBJECT_UNICODE:
case PR_CONVERSATION_TOPIC_UNICODE:
rc = [self getChildProperty: data forKey: childKey
withTag: PR_NORMALIZED_SUBJECT_UNICODE];
break;
case PR_SUBJECT_PREFIX_UNICODE:
*data = [@"" asUnicodeInMemCtx: memCtx];
break;
case PR_NORMALIZED_SUBJECT_UNICODE:
rc = [self getChildProperty: data forKey: childKey
withTag: PR_SUBJECT_UNICODE];
break;
case PR_DISPLAY_TO_UNICODE:

View File

@ -68,8 +68,6 @@
*data = talloc_strdup(memCtx, "IPM.Task");
break;
case PR_SUBJECT_UNICODE: // SUMMARY
case PR_NORMALIZED_SUBJECT_UNICODE:
case PR_CONVERSATION_TOPIC_UNICODE:
task = [[self lookupChild: childKey] component: NO secure: NO];
*data = [[task summary] asUnicodeInMemCtx: memCtx];
break;