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



commit ad9c72c7542c5793e6db6deb63c143ce515bc171
Author: Milan Crha <mcrha redhat com>
Date:   Tue Nov 22 17:57:57 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.

 camel/providers/imapx/camel-imapx-server.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index 4d48563..eb58753 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -5484,6 +5484,11 @@ camel_imapx_server_sync_changes_sync (CamelIMAPXServer *is,
                                if (info == NULL)
                                        continue;
 
+                               if (!(info->info.flags & CAMEL_MESSAGE_FOLDER_FLAGGED)) {
+                                       camel_message_info_unref (info);
+                                       continue;
+                               }
+
                                flags = (info->info.flags & CAMEL_IMAPX_SERVER_FLAGS) & permanentflags;
                                sflags = (info->server_flags & CAMEL_IMAPX_SERVER_FLAGS) & permanentflags;
                                send = 0;
@@ -5535,6 +5540,18 @@ camel_imapx_server_sync_changes_sync (CamelIMAPXServer *is,
                                camel_message_info_unref (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);
                }
 
@@ -5591,6 +5608,11 @@ camel_imapx_server_sync_changes_sync (CamelIMAPXServer *is,
                        if (!xinfo)
                                continue;
 
+                       if (!(xinfo->info.flags & CAMEL_MESSAGE_FOLDER_FLAGGED)) {
+                               camel_message_info_unref (xinfo);
+                               continue;
+                       }
+
                        xinfo->server_flags = xinfo->info.flags & CAMEL_IMAPX_SERVER_FLAGS;
                        if (!remove_deleted_flags ||
                            !(xinfo->info.flags & CAMEL_MESSAGE_DELETED)) {


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