Debian Wheezy x86
First of all, thank you very much to foudfou and the other contributors for this rewrite of a great extension. You've done a great job so far!
I've been noticing a small bug with accounts that have this uncommon IMAP folder structure: Everything is a subfolder of Inbox, including Drafts, Sent, Junk, etc., see this screenshot:
(Don't ask me why one of my ISPs has this uncommon type of structure -- I'm not able to change it unfortunately. Maybe I should ask them if they could change it for me...)
For the sake of completeness, in my view a common structure (which doesn't cause the problem described in the following paragraph) should look like this :
Anyway, the problem is that -- although I have, e.g., unchecked Drafts in the included special folders list -- unread messages in this subfolder are still counted. There is one restriction though: The counter is not updated until a new message comes in or I mark a message as unread in any of the folders that are not in the excluded folders list. Same applies for the inverse direction, i.e., if I mark the message in the Drafts subfolder as read again, the counter won't be updated (decreased by one) until something has changed in the other folders that are not in the excluded folders list.
If I check Drafts in the included special folders list, the event for updating the message count fires immediately when messages inside Drafts are marked as unread. Hence, in this case, the Drafts folder is recognized as such although it's still a subfolder of Inbox.
I've already had a look at the source code but I'm still not sure what causes this bug.
The reason is that the check for excludedFoldersFlags is done in countMessages() for each parent folder. If a parent folder is excluded, all of it's childs would be excluded, too (even with my patch from #21). If a parent folder is included, the check won't be repeated for any child folder.
Oh yes, got it, of course you're right and you've even fixed it already. Thank you!
Sorry I haven't looked closely at this issue yet, but you may be interested about:
Account settings > Server Settings > Advanced > IMAP server directory: [Gmail]
This produces a "flat" structure, with all folders included in Inbox at the same level.
Thanks for the tip -- doesn't seem to work with the particular IMAP server I use, though (it just has no effect).
Fixed by Cybso. I hope to be able to include the patch on #45 soon.
I merged Cybso's fix but worked further on the message counting. I believe it's working correctly, so I'll close this issue. If you feel otherwise, please re-open it.
I'll check it out soon, thank you!