diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/async/imap/MCIMAPMultiDisconnectOperation.cc | 1 | ||||
-rw-r--r-- | src/core/abstract/MCMessageConstants.h | 1 | ||||
-rw-r--r-- | src/core/imap/MCIMAPSearchExpression.cc | 8 | ||||
-rw-r--r-- | src/core/imap/MCIMAPSearchExpression.h | 2 | ||||
-rwxr-xr-x | src/core/imap/MCIMAPSession.cc | 5 | ||||
-rw-r--r-- | src/objc/abstract/MCOAddress.h | 2 | ||||
-rw-r--r-- | src/objc/abstract/MCOConstants.h | 2 | ||||
-rw-r--r-- | src/objc/abstract/MCOMessageHeader.h | 2 | ||||
-rw-r--r-- | src/objc/imap/MCOIMAPMessage.h | 2 | ||||
-rw-r--r-- | src/objc/imap/MCOIMAPMessagePart.h | 2 | ||||
-rw-r--r-- | src/objc/imap/MCOIMAPMultipart.h | 2 | ||||
-rw-r--r-- | src/objc/imap/MCOIMAPPart.h | 2 | ||||
-rw-r--r-- | src/objc/imap/MCOIMAPSearchExpression.h | 12 | ||||
-rw-r--r-- | src/objc/imap/MCOIMAPSearchExpression.mm | 6 | ||||
-rw-r--r-- | src/objc/utils/MCOIndexSet.h | 2 |
15 files changed, 44 insertions, 7 deletions
diff --git a/src/async/imap/MCIMAPMultiDisconnectOperation.cc b/src/async/imap/MCIMAPMultiDisconnectOperation.cc index e58bfd92..c33eb1bb 100644 --- a/src/async/imap/MCIMAPMultiDisconnectOperation.cc +++ b/src/async/imap/MCIMAPMultiDisconnectOperation.cc @@ -34,6 +34,7 @@ void IMAPMultiDisconnectOperation::start() } mc_foreacharray(IMAPOperation, op, _operations) { + op->setCallbackDispatchQueue(this->callbackDispatchQueue()); op->setCallback(this); op->start(); } diff --git a/src/core/abstract/MCMessageConstants.h b/src/core/abstract/MCMessageConstants.h index c2f77c89..b7bebe3a 100644 --- a/src/core/abstract/MCMessageConstants.h +++ b/src/core/abstract/MCMessageConstants.h @@ -198,6 +198,7 @@ namespace mailcore { IMAPSearchKindGmailRaw, IMAPSearchKindOr, IMAPSearchKindAnd, + IMAPSearchKindNot, }; enum ErrorCode { diff --git a/src/core/imap/MCIMAPSearchExpression.cc b/src/core/imap/MCIMAPSearchExpression.cc index 5838be00..2c6657af 100644 --- a/src/core/imap/MCIMAPSearchExpression.cc +++ b/src/core/imap/MCIMAPSearchExpression.cc @@ -339,6 +339,14 @@ IMAPSearchExpression * IMAPSearchExpression::searchOr(IMAPSearchExpression * lef return (IMAPSearchExpression *) expr->autorelease(); } +IMAPSearchExpression * IMAPSearchExpression::searchNot(IMAPSearchExpression * notExpr) +{ + IMAPSearchExpression * expr = new IMAPSearchExpression(); + expr->mKind = IMAPSearchKindNot; + MC_SAFE_REPLACE_RETAIN(IMAPSearchExpression, expr->mLeftExpression, notExpr); + return (IMAPSearchExpression *) expr->autorelease(); +} + IMAPSearchKind IMAPSearchExpression::kind() { return mKind; diff --git a/src/core/imap/MCIMAPSearchExpression.h b/src/core/imap/MCIMAPSearchExpression.h index c108fd2b..928b9d41 100644 --- a/src/core/imap/MCIMAPSearchExpression.h +++ b/src/core/imap/MCIMAPSearchExpression.h @@ -57,6 +57,8 @@ namespace mailcore { static IMAPSearchExpression * searchGmailRaw(String * expr); static IMAPSearchExpression * searchAnd(IMAPSearchExpression * left, IMAPSearchExpression * right); static IMAPSearchExpression * searchOr(IMAPSearchExpression * left, IMAPSearchExpression * right); + static IMAPSearchExpression * searchNot(IMAPSearchExpression * notExpr); + public: // subclass behavior IMAPSearchExpression(IMAPSearchExpression * other); diff --git a/src/core/imap/MCIMAPSession.cc b/src/core/imap/MCIMAPSession.cc index 02e569dc..3108ac3e 100755 --- a/src/core/imap/MCIMAPSession.cc +++ b/src/core/imap/MCIMAPSession.cc @@ -2906,6 +2906,11 @@ static struct mailimap_search_key * searchKeyFromSearchExpression(IMAPSearchExpr clist_append(list, searchKeyFromSearchExpression(expression->rightExpression())); return mailimap_search_key_new_multiple(list); } + case IMAPSearchKindNot: + { + return mailimap_search_key_new_not(searchKeyFromSearchExpression(expression->leftExpression())); + } + default: MCAssert(0); return NULL; diff --git a/src/objc/abstract/MCOAddress.h b/src/objc/abstract/MCOAddress.h index 82aa5280..473c8428 100644 --- a/src/objc/abstract/MCOAddress.h +++ b/src/objc/abstract/MCOAddress.h @@ -12,7 +12,7 @@ #import <Foundation/Foundation.h> -@interface MCOAddress : NSObject <NSCopying> +@interface MCOAddress : NSObject <NSCopying, NSCoding> /** Creates an address with a display name and a mailbox. diff --git a/src/objc/abstract/MCOConstants.h b/src/objc/abstract/MCOConstants.h index 6b6407c0..28fa9e05 100644 --- a/src/objc/abstract/MCOConstants.h +++ b/src/objc/abstract/MCOConstants.h @@ -190,6 +190,8 @@ typedef enum { MCOIMAPSearchKindOr, /** And expression.*/ MCOIMAPSearchKindAnd, + /** Not expression.*/ + MCOIMAPSearchKindNot, } MCOIMAPSearchKind; /** Keys for the namespace dictionary.*/ diff --git a/src/objc/abstract/MCOMessageHeader.h b/src/objc/abstract/MCOMessageHeader.h index f47e71b6..4d11bb6c 100644 --- a/src/objc/abstract/MCOMessageHeader.h +++ b/src/objc/abstract/MCOMessageHeader.h @@ -16,7 +16,7 @@ @class MCOAddress; -@interface MCOMessageHeader : NSObject <NSCopying> +@interface MCOMessageHeader : NSObject <NSCopying, NSCoding> /** Message-ID field.*/ @property (nonatomic, copy) NSString * messageID; diff --git a/src/objc/imap/MCOIMAPMessage.h b/src/objc/imap/MCOIMAPMessage.h index f4587636..7ca40b9e 100644 --- a/src/objc/imap/MCOIMAPMessage.h +++ b/src/objc/imap/MCOIMAPMessage.h @@ -29,7 +29,7 @@ @protocol MCOHTMLRendererIMAPDelegate; -@interface MCOIMAPMessage : MCOAbstractMessage +@interface MCOIMAPMessage : MCOAbstractMessage <NSCoding> /** IMAP UID of the message. */ @property (nonatomic, assign) uint32_t uid; diff --git a/src/objc/imap/MCOIMAPMessagePart.h b/src/objc/imap/MCOIMAPMessagePart.h index 8f4f531f..c455d336 100644 --- a/src/objc/imap/MCOIMAPMessagePart.h +++ b/src/objc/imap/MCOIMAPMessagePart.h @@ -14,7 +14,7 @@ #import <MailCore/MCOAbstractMessagePart.h> -@interface MCOIMAPMessagePart : MCOAbstractMessagePart +@interface MCOIMAPMessagePart : MCOAbstractMessagePart <NSCoding> /** A part identifier is of the form 1.2.1*/ @property (nonatomic, copy) NSString * partID; diff --git a/src/objc/imap/MCOIMAPMultipart.h b/src/objc/imap/MCOIMAPMultipart.h index 0b5997de..c083f425 100644 --- a/src/objc/imap/MCOIMAPMultipart.h +++ b/src/objc/imap/MCOIMAPMultipart.h @@ -14,7 +14,7 @@ #import <MailCore/MCOAbstractMultipart.h> -@interface MCOIMAPMultipart : MCOAbstractMultipart +@interface MCOIMAPMultipart : MCOAbstractMultipart <NSCoding> /** A part identifier looks like 1.2.1 */ @property (nonatomic, copy) NSString * partID; diff --git a/src/objc/imap/MCOIMAPPart.h b/src/objc/imap/MCOIMAPPart.h index 814aa0a8..660113b5 100644 --- a/src/objc/imap/MCOIMAPPart.h +++ b/src/objc/imap/MCOIMAPPart.h @@ -16,7 +16,7 @@ /** Represents a single IMAP message part */ -@interface MCOIMAPPart : MCOAbstractPart +@interface MCOIMAPPart : MCOAbstractPart <NSCoding> /** A part identifier looks like 1.2.1 */ @property (nonatomic, copy) NSString * partID; diff --git a/src/objc/imap/MCOIMAPSearchExpression.h b/src/objc/imap/MCOIMAPSearchExpression.h index d1d2d701..3ff956b2 100644 --- a/src/objc/imap/MCOIMAPSearchExpression.h +++ b/src/objc/imap/MCOIMAPSearchExpression.h @@ -320,6 +320,18 @@ */ + (MCOIMAPSearchExpression *) searchOr:(MCOIMAPSearchExpression *)expression other:(MCOIMAPSearchExpression *)other; +/** + Creates a search expression that matches when the argument is not matched. + + Example: + + MCOIMAPSearchExpression * exprSubject = [MCOIMAPSearchExpression searchSubject:@"airline"] + MCOIMAPSearchExpression * expr = [MCOIMAPSearchExpression searchNot:exprSubject]; + The expression will match when the subject does not contain the word airline + + */ ++ (MCOIMAPSearchExpression *) searchNot:(MCOIMAPSearchExpression *)expression; + @end #endif diff --git a/src/objc/imap/MCOIMAPSearchExpression.mm b/src/objc/imap/MCOIMAPSearchExpression.mm index a6c89e8d..020acdb8 100644 --- a/src/objc/imap/MCOIMAPSearchExpression.mm +++ b/src/objc/imap/MCOIMAPSearchExpression.mm @@ -217,4 +217,10 @@ return MCO_TO_OBJC(result); } ++ (MCOIMAPSearchExpression *) searchNot:(MCOIMAPSearchExpression *)expression +{ + mailcore::IMAPSearchExpression * result = mailcore::IMAPSearchExpression::searchNot(expression->_nativeExpr); + return MCO_TO_OBJC(result); +} + @end diff --git a/src/objc/utils/MCOIndexSet.h b/src/objc/utils/MCOIndexSet.h index 9188ba65..0cd18d15 100644 --- a/src/objc/utils/MCOIndexSet.h +++ b/src/objc/utils/MCOIndexSet.h @@ -16,7 +16,7 @@ /** similar to NSMutableIndexSet but supports int64_t*/ -@interface MCOIndexSet : NSObject <NSCopying> +@interface MCOIndexSet : NSObject <NSCopying, NSCoding> /** Creates an empty index set.*/ + (MCOIndexSet *) indexSet; |