[evolution-data-server] Bug 782844 - Folder changes not always saved
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Bug 782844 - Folder changes not always saved
- Date: Tue, 4 Jul 2017 07:06:04 +0000 (UTC)
commit 6f1911235bf6875d9902cda119a05ae256ebb2b5
Author: Milan Crha <mcrha redhat com>
Date: Tue Jul 4 09:05:51 2017 +0200
Bug 782844 - Folder changes not always saved
src/camel/camel-folder-summary.c | 2 +-
src/camel/camel-folder.c | 13 +++++++++----
src/camel/providers/imapx/camel-imapx-server.c | 8 ++++++--
3 files changed, 16 insertions(+), 7 deletions(-)
---
diff --git a/src/camel/camel-folder-summary.c b/src/camel/camel-folder-summary.c
index 6094f42..4286bda 100644
--- a/src/camel/camel-folder-summary.c
+++ b/src/camel/camel-folder-summary.c
@@ -1949,7 +1949,7 @@ camel_read_mir_callback (gpointer ref,
/* Just now we are reading from the DB, it can't be dirty. */
camel_message_info_set_dirty (info, FALSE);
if (data->add) {
- camel_folder_summary_add (summary, info, FALSE);
+ camel_folder_summary_add (summary, info, TRUE);
g_clear_object (&info);
} else {
camel_folder_summary_lock (summary);
diff --git a/src/camel/camel-folder.c b/src/camel/camel-folder.c
index b6efd2e..6c2dd10 100644
--- a/src/camel/camel-folder.c
+++ b/src/camel/camel-folder.c
@@ -340,7 +340,7 @@ folder_filter (CamelSession *session,
camel_operation_pop_message (cancellable);
}
- if (*error != NULL)
+ if (error && *error)
goto exit;
if (data->notjunk) {
@@ -383,14 +383,14 @@ folder_filter (CamelSession *session,
camel_operation_pop_message (cancellable);
}
- if (*error != NULL)
+ if (error && *error)
goto exit;
if (synchronize)
camel_junk_filter_synchronize (
junk_filter, cancellable, error);
- if (*error != NULL)
+ if (error && *error)
goto exit;
if (data->driver && data->recents) {
@@ -423,7 +423,7 @@ folder_filter (CamelSession *session,
info = camel_folder_get_message_info (
data->folder, uid);
if (info == NULL) {
- g_warning (
+ g_debug (
"uid '%s' vanished from folder '%s : %s'",
uid, camel_service_get_display_name (CAMEL_SERVICE (parent_store)),
full_name);
continue;
@@ -439,6 +439,11 @@ folder_filter (CamelSession *session,
camel_operation_pop_message (cancellable);
camel_filter_driver_flush (data->driver, error);
+
+ /* Save flag/info changes made by the filter */
+ if (error && !*error)
+ camel_folder_synchronize_sync (data->folder, FALSE, cancellable, error);
+
} else if (data->driver) {
camel_filter_driver_log_info (data->driver, "No recent messages reported in '%s : %s'",
camel_service_get_display_name (CAMEL_SERVICE (parent_store)), full_name);
diff --git a/src/camel/providers/imapx/camel-imapx-server.c b/src/camel/providers/imapx/camel-imapx-server.c
index a980f03..e753789 100644
--- a/src/camel/providers/imapx/camel-imapx-server.c
+++ b/src/camel/providers/imapx/camel-imapx-server.c
@@ -1384,7 +1384,7 @@ imapx_untagged_fetch (CamelIMAPXServer *is,
if (!camel_folder_summary_check_uid (camel_folder_get_folder_summary (folder),
finfo->uid)) {
imapx_set_message_info_flags_for_new_message (mi, server_flags,
server_user_flags, FALSE, NULL, camel_imapx_mailbox_get_permanentflags (mailbox));
- camel_folder_summary_add (camel_folder_get_folder_summary (folder), mi,
FALSE);
+ camel_folder_summary_add (camel_folder_get_folder_summary (folder), mi, TRUE);
g_mutex_lock (&is->priv->changes_lock);
@@ -1398,6 +1398,8 @@ imapx_untagged_fetch (CamelIMAPXServer *is,
camel_operation_progress (cancellable, cnt ? cnt : 1);
}
+
+ camel_folder_summary_save (camel_folder_get_folder_summary (folder), NULL);
}
g_clear_object (&mi);
@@ -4704,12 +4706,14 @@ camel_imapx_server_append_message_sync (CamelIMAPXServer *is,
camel_message_info_get_user_tags (info),
camel_imapx_mailbox_get_permanentflags (mailbox));
- camel_folder_summary_add (camel_folder_get_folder_summary (folder), mi,
FALSE);
+ camel_folder_summary_add (camel_folder_get_folder_summary (folder), mi, TRUE);
g_mutex_lock (&is->priv->changes_lock);
camel_folder_change_info_add_uid (is->priv->changes,
camel_message_info_get_uid (mi));
g_mutex_unlock (&is->priv->changes_lock);
+ camel_folder_summary_save (camel_folder_get_folder_summary (folder), NULL);
+
if (appended_uid)
*appended_uid = uid;
else
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]