Bug #721286 - IMAPx: read messages become unread when reopening Evolution
authorMilan Crha <mcrha@redhat.com>
Wed, 29 Jan 2014 11:50:57 +0000 (12:50 +0100)
committerMilan Crha <mcrha@redhat.com>
Wed, 29 Jan 2014 11:50:57 +0000 (12:50 +0100)
commitc7ef1c9d0223a6e80c11e962d4c0433389bdb54b
treeae4f793b0fe3302c5242a14004bec0e258b7f18f
parentb1cbe039a1225d637208b1d6d75a501bc89206bc
Bug #721286 - IMAPx: read messages become unread when reopening Evolution

Couple things changed here:

a) the camel_folder_summary_get_changed() could return list of changed
   messages only if they were loaded in memory, which is not correct - I
   think it's part of the issue why it failed

b) it could happen that imapx_server_sync_changes() was called to save some
   changes, but then didn't change anything; in such cases, messages marked
   as locally changed were never unmarked, which led to false tests; I added
   a function to unmark the messages as locally changed (this can cause slow
   close of evolution for the first time, due to unsetting of the flag, but
   later ends are fine)

c) state of the message flags on the server is the master state, except of
   the state where locally stored info is marked as locally changed. This
   allows to show proper state of messages on the server (it is influenced
   by a) and b) too, so it might take up to two evolution starts to get
   the same view in evolution as is the state on the server).
camel/camel-folder-summary.c
camel/providers/imapx/camel-imapx-server.c
camel/providers/imapx/camel-imapx-utils.c