[evolution-data-server] [IMAPx] Local flag changes could be missed and left unsaved on the server



commit 15d57ff0be780a6f1850fe662d2dbb0913219cf8
Author: Milan Crha <mcrha redhat com>
Date:   Tue Nov 22 17:43:54 2016 +0100

    [IMAPx] Local flag changes could be missed and left unsaved on the server
    
    It could happen sometimes that the local changes were not saved to the server.
    This change tries to address it.

 src/camel/providers/imapx/camel-imapx-server.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/src/camel/providers/imapx/camel-imapx-server.c b/src/camel/providers/imapx/camel-imapx-server.c
index a8febc3..bca196f 100644
--- a/src/camel/providers/imapx/camel-imapx-server.c
+++ b/src/camel/providers/imapx/camel-imapx-server.c
@@ -5458,6 +5458,11 @@ camel_imapx_server_sync_changes_sync (CamelIMAPXServer *is,
                                guint32 sflags;
                                gint send;
 
+                               /* the 'stamps' hash table contains only those uid-s,
+                                  which were also flagged, not only 'dirty' */
+                               if (!g_hash_table_lookup (stamps, changed_uids->pdata[i]))
+                                       continue;
+
                                info = camel_folder_summary_get (camel_folder_get_folder_summary (folder), 
changed_uids->pdata[i]);
                                xinfo = info ? CAMEL_IMAPX_MESSAGE_INFO (info) : NULL;
 
@@ -5518,6 +5523,18 @@ camel_imapx_server_sync_changes_sync (CamelIMAPXServer *is,
                                g_clear_object (&info);
                        }
 
+                       if (ic && imapx_uidset_done (&uidset, ic)) {
+                               camel_imapx_command_add (ic, " %tFLAGS.SILENT (%t)", on ? "+" : "-", 
flags_table[jj].name);
+
+                               success = camel_imapx_server_process_command_sync (is, ic, _("Error syncing 
changes"), cancellable, error);
+
+                               camel_imapx_command_unref (ic);
+                               ic = NULL;
+
+                               if (!success)
+                                       break;
+                       }
+
                        g_warn_if_fail (ic == NULL);
                }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]