Monotone-Parent: 58749c14c4e65b3991fa8ffd498965821ad031ce

Monotone-Revision: 5f859ec68ac3088a6a1a60e1cf887c3208974571

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2011-02-14T17:28:00
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2011-02-14 17:28:00 +00:00
parent 545e3a9bfc
commit 4d24b2fc4d
2 changed files with 30 additions and 23 deletions

View File

@ -1,5 +1,10 @@
2011-02-14 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* OpenChange/MAPIStoreMailMessageTable.m (-restrictedChildKeys):
no longer excluded messages marked with "\Deleted".
(-getChildProperty:forKey:withTag:): display the right icon for
replied, forwarded, read/unread and deleted messages.
* OpenChange/MAPIStoreMailFolderTable.m
(-getChildProperty:forKey:withTag:): compute propre response for
PR_CONTENT_UNREAD, even though this will work only for subfolders

View File

@ -79,21 +79,10 @@
static Class NSDataK, NSStringK;
static EOQualifier *nonDeletedQualifier = nil;
+ (void) initialize
{
EOKeyValueQualifier *deletedQualifier;
NSDataK = [NSData class];
NSStringK = [NSString class];
deletedQualifier = [[EOKeyValueQualifier alloc]
initWithKey: @"FLAGS"
operatorSelector: EOQualifierOperatorContains
value: [NSArray arrayWithObject: @"DELETED"]];
nonDeletedQualifier = [[EONotQualifier alloc]
initWithQualifier: deletedQualifier];
[deletedQualifier release];
}
- (id) init
@ -114,7 +103,7 @@ static EOQualifier *nonDeletedQualifier = nil;
- (NSArray *) childKeys
{
return [[folder fetchUIDsMatchingQualifier: nonDeletedQualifier
return [[folder fetchUIDsMatchingQualifier: nil
sortOrdering: sortOrdering]
stringsWithFormat: @"%@.eml"];
}
@ -122,7 +111,6 @@ static EOQualifier *nonDeletedQualifier = nil;
- (NSArray *) restrictedChildKeys
{
NSArray *keys;
EOAndQualifier *andQualifier;
if (restrictionState == MAPIRestrictionStateAlwaysTrue)
keys = [self cachedChildKeys];
@ -130,12 +118,9 @@ static EOQualifier *nonDeletedQualifier = nil;
keys = [NSArray array];
else
{
andQualifier = [[EOAndQualifier alloc]
initWithQualifiers: restriction, nonDeletedQualifier, nil];
keys = [[folder fetchUIDsMatchingQualifier: andQualifier
keys = [[folder fetchUIDsMatchingQualifier: restriction
sortOrdering: sortOrdering]
stringsWithFormat: @"%@.eml"];
[andQualifier release];
[self logWithFormat: @" restricted keys: %@", keys];
}
@ -149,14 +134,34 @@ static EOQualifier *nonDeletedQualifier = nil;
SOGoMailObject *child;
NSString *subject, *stringValue;
NSInteger colIdx;
uint32_t intValue;
enum MAPISTATUS rc;
rc = MAPI_E_SUCCESS;
switch (propTag)
{
case PR_ICON_INDEX: // TODO
/* read mail, see http://msdn.microsoft.com/en-us/library/cc815472.aspx */
*data = MAPILongValue (memCtx, 0x00000100);
case PR_ICON_INDEX:
/* see http://msdn.microsoft.com/en-us/library/cc815472.aspx */
child = [self lookupChild: childKey];
if ([child isNewMail])
intValue = 0xffffffff;
else if ([child replied])
intValue = 0x105;
else if ([child forwarded])
intValue = 0x106;
else if ([child read])
intValue = 0x100;
else
intValue = 0x101;
*data = MAPILongValue (memCtx, intValue);
break;
case PidLidImapDeleted:
child = [self lookupChild: childKey];
if ([child deleted])
intValue = 1;
else
intValue = 0;
*data = MAPILongValue (memCtx, intValue);
break;
case PR_SUBJECT_UNICODE:
child = [self lookupChild: childKey];
@ -499,9 +504,6 @@ static EOQualifier *nonDeletedQualifier = nil;
case PidLidPrivate:
*data = MAPIBoolValue (memCtx, NO);
break;
case PidLidImapDeleted:
*data = MAPILongValue (memCtx, 0);
break;
case PR_MSG_EDITOR_FORMAT:
{