mronge/MailCore — pull request #50 by NZKoz (2012-10-04 20:47:27+00:00)
Title: Ensure flag changes are persisted to imap after setFlags:forMesssage: is called

With libetpan `mailmessage_check` only updates the in memory store of the flags for a given message, it doesn't make any changes over the wire. You must ensure that `imap_flags_store_process` is called otherwise the data is lost.

There are a few options for ensuring this is called:

* `imapdriver_uninitialize`
* `imapdriver_logout`
* `imapdriver_check_folder`
* `imapdriver_select_folder`
* `imapdriver_expunge_folder`
* `imapdriver_get_envelopes_list`

Calling `CHECK` seemed the lowest cost alternative out there.

The current implementation of `setFlags:forMessage` only works if you either explicitly log out, expunge or select another folder, my particular application doesn't usually do any of those things as it only handles a single mailbox and is more likely to get suspended by a user than explicitly log out / dealloc the CTCoreFolder