Fix unseen count retrieval of nested IMAP folders

pull/201/head
Francis Lachapelle 2016-02-26 14:59:54 -05:00
parent 50c790c846
commit a668d89ef9
4 changed files with 28 additions and 5 deletions

1
NEWS
View File

@ -36,6 +36,7 @@ Bug fixes
- [web] fixed fab button position in Calendar module (#3462)
- [web] fixed default priority of sent messages (#3542)
- [web] removed double-quotes from Chinese (Taiwan) translations that were breaking templates
- [web] fixed unseen count retrieval of nested IMAP folders
- [eas] allow EAS attachments get on 2nd-level mailboxes (#3505)
- [eas] fix EAS bday shift (#3518)

View File

@ -90,7 +90,11 @@ typedef enum {
- (BOOL) isInDraftsFolder;
/* special folders */
- (id) lookupNameByPaths: (NSArray *) _paths
inContext: (id)_ctx
acquire: (BOOL) _flag;
/* special folders */
- (NSString *) inboxFolderNameInContext: (id)_ctx;
- (NSString *) draftsFolderNameInContext: (id)_ctx;
- (NSString *) sentFolderNameInContext: (id)_ctx;

View File

@ -819,6 +819,25 @@ static NSString *inboxFolderName = @"INBOX";
/* name lookup */
- (id) lookupNameByPaths: (NSArray *) _paths
inContext: (id)_ctx
acquire: (BOOL) _flag
{
NSString *folderName;
NSUInteger count, max;
SOGoMailBaseObject *folder;
max = [_paths count];
folder = self;
for (count = 0; folder && count < max; count++)
{
folderName = [_paths objectAtIndex: count];
folder = [folder lookupName: folderName inContext: _ctx acquire: _flag];
}
return folder;
}
- (id) lookupName: (NSString *) _key
inContext: (id)_ctx
acquire: (BOOL) _flag

View File

@ -641,10 +641,9 @@
account = [[self clientObject] lookupName: [pathComponents objectAtIndex: 0]
inContext: context
acquire: YES];
folder = [account lookupName: [NSString pathWithComponents: [pathComponents subarrayWithRange: NSMakeRange(1, [pathComponents count]-1)]]
inContext: context
acquire: YES];
folder = [account lookupNameByPaths: [pathComponents subarrayWithRange: NSMakeRange(1, [pathComponents count]-1)]
inContext: context
acquire: YES];
return [folder unseenCount];
}