Monotone-Parent: 58749c14c4e65b3991fa8ffd498965821ad031ce
Monotone-Revision: 5f859ec68ac3088a6a1a60e1cf887c3208974571 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-02-14T17:28:00 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
parent
545e3a9bfc
commit
4d24b2fc4d
|
@ -1,5 +1,10 @@
|
||||||
2011-02-14 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
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
|
* OpenChange/MAPIStoreMailFolderTable.m
|
||||||
(-getChildProperty:forKey:withTag:): compute propre response for
|
(-getChildProperty:forKey:withTag:): compute propre response for
|
||||||
PR_CONTENT_UNREAD, even though this will work only for subfolders
|
PR_CONTENT_UNREAD, even though this will work only for subfolders
|
||||||
|
|
|
@ -79,21 +79,10 @@
|
||||||
|
|
||||||
static Class NSDataK, NSStringK;
|
static Class NSDataK, NSStringK;
|
||||||
|
|
||||||
static EOQualifier *nonDeletedQualifier = nil;
|
|
||||||
|
|
||||||
+ (void) initialize
|
+ (void) initialize
|
||||||
{
|
{
|
||||||
EOKeyValueQualifier *deletedQualifier;
|
|
||||||
|
|
||||||
NSDataK = [NSData class];
|
NSDataK = [NSData class];
|
||||||
NSStringK = [NSString class];
|
NSStringK = [NSString class];
|
||||||
deletedQualifier = [[EOKeyValueQualifier alloc]
|
|
||||||
initWithKey: @"FLAGS"
|
|
||||||
operatorSelector: EOQualifierOperatorContains
|
|
||||||
value: [NSArray arrayWithObject: @"DELETED"]];
|
|
||||||
nonDeletedQualifier = [[EONotQualifier alloc]
|
|
||||||
initWithQualifier: deletedQualifier];
|
|
||||||
[deletedQualifier release];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) init
|
- (id) init
|
||||||
|
@ -114,7 +103,7 @@ static EOQualifier *nonDeletedQualifier = nil;
|
||||||
|
|
||||||
- (NSArray *) childKeys
|
- (NSArray *) childKeys
|
||||||
{
|
{
|
||||||
return [[folder fetchUIDsMatchingQualifier: nonDeletedQualifier
|
return [[folder fetchUIDsMatchingQualifier: nil
|
||||||
sortOrdering: sortOrdering]
|
sortOrdering: sortOrdering]
|
||||||
stringsWithFormat: @"%@.eml"];
|
stringsWithFormat: @"%@.eml"];
|
||||||
}
|
}
|
||||||
|
@ -122,7 +111,6 @@ static EOQualifier *nonDeletedQualifier = nil;
|
||||||
- (NSArray *) restrictedChildKeys
|
- (NSArray *) restrictedChildKeys
|
||||||
{
|
{
|
||||||
NSArray *keys;
|
NSArray *keys;
|
||||||
EOAndQualifier *andQualifier;
|
|
||||||
|
|
||||||
if (restrictionState == MAPIRestrictionStateAlwaysTrue)
|
if (restrictionState == MAPIRestrictionStateAlwaysTrue)
|
||||||
keys = [self cachedChildKeys];
|
keys = [self cachedChildKeys];
|
||||||
|
@ -130,12 +118,9 @@ static EOQualifier *nonDeletedQualifier = nil;
|
||||||
keys = [NSArray array];
|
keys = [NSArray array];
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
andQualifier = [[EOAndQualifier alloc]
|
keys = [[folder fetchUIDsMatchingQualifier: restriction
|
||||||
initWithQualifiers: restriction, nonDeletedQualifier, nil];
|
|
||||||
keys = [[folder fetchUIDsMatchingQualifier: andQualifier
|
|
||||||
sortOrdering: sortOrdering]
|
sortOrdering: sortOrdering]
|
||||||
stringsWithFormat: @"%@.eml"];
|
stringsWithFormat: @"%@.eml"];
|
||||||
[andQualifier release];
|
|
||||||
[self logWithFormat: @" restricted keys: %@", keys];
|
[self logWithFormat: @" restricted keys: %@", keys];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,14 +134,34 @@ static EOQualifier *nonDeletedQualifier = nil;
|
||||||
SOGoMailObject *child;
|
SOGoMailObject *child;
|
||||||
NSString *subject, *stringValue;
|
NSString *subject, *stringValue;
|
||||||
NSInteger colIdx;
|
NSInteger colIdx;
|
||||||
|
uint32_t intValue;
|
||||||
enum MAPISTATUS rc;
|
enum MAPISTATUS rc;
|
||||||
|
|
||||||
rc = MAPI_E_SUCCESS;
|
rc = MAPI_E_SUCCESS;
|
||||||
switch (propTag)
|
switch (propTag)
|
||||||
{
|
{
|
||||||
case PR_ICON_INDEX: // TODO
|
case PR_ICON_INDEX:
|
||||||
/* read mail, see http://msdn.microsoft.com/en-us/library/cc815472.aspx */
|
/* see http://msdn.microsoft.com/en-us/library/cc815472.aspx */
|
||||||
*data = MAPILongValue (memCtx, 0x00000100);
|
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;
|
break;
|
||||||
case PR_SUBJECT_UNICODE:
|
case PR_SUBJECT_UNICODE:
|
||||||
child = [self lookupChild: childKey];
|
child = [self lookupChild: childKey];
|
||||||
|
@ -499,9 +504,6 @@ static EOQualifier *nonDeletedQualifier = nil;
|
||||||
case PidLidPrivate:
|
case PidLidPrivate:
|
||||||
*data = MAPIBoolValue (memCtx, NO);
|
*data = MAPIBoolValue (memCtx, NO);
|
||||||
break;
|
break;
|
||||||
case PidLidImapDeleted:
|
|
||||||
*data = MAPILongValue (memCtx, 0);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PR_MSG_EDITOR_FORMAT:
|
case PR_MSG_EDITOR_FORMAT:
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue