[evolution-ews] Bug 738945 - Missing folder changed notify after message append
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-ews] Bug 738945 - Missing folder changed notify after message append
- Date: Tue, 11 Nov 2014 15:09:38 +0000 (UTC)
commit 5caf6d8d9268bbf18b54cc2f700d97d84ff9ee4b
Author: Milan Crha <mcrha redhat com>
Date: Tue Nov 11 16:08:33 2014 +0100
Bug 738945 - Missing folder changed notify after message append
src/camel/camel-ews-folder.c | 17 ++++++++++++++---
src/camel/camel-ews-summary.c | 12 +++++++-----
src/camel/camel-ews-summary.h | 3 ++-
3 files changed, 23 insertions(+), 9 deletions(-)
---
diff --git a/src/camel/camel-ews-folder.c b/src/camel/camel-ews-folder.c
index f02a3ba..0e964bb 100644
--- a/src/camel/camel-ews-folder.c
+++ b/src/camel/camel-ews-folder.c
@@ -1884,7 +1884,18 @@ ews_append_message_sync (CamelFolder *folder,
e_ews_folder_id_free (fid);
g_free (folder_id);
- camel_ews_summary_add_message (folder->summary, itemid, changekey, info, message);
+ if (camel_ews_summary_add_message (folder->summary, itemid, changekey, info, message)) {
+ CamelFolderChangeInfo *changes;
+
+ changes = camel_folder_change_info_new ();
+
+ camel_folder_change_info_add_uid (changes, itemid);
+
+ if (camel_folder_change_info_changed (changes))
+ camel_folder_changed (folder, changes);
+
+ camel_folder_change_info_free (changes);
+ }
if (appended_uid)
*appended_uid = itemid;
@@ -2008,8 +2019,8 @@ ews_transfer_messages_to_sync (CamelFolder *source,
clone = camel_message_info_clone (info);
- camel_ews_summary_add_message (destination->summary, id->id, id->change_key, clone,
message);
- camel_folder_change_info_add_uid (changes, id->id);
+ if (camel_ews_summary_add_message (destination->summary, id->id, id->change_key,
clone, message))
+ camel_folder_change_info_add_uid (changes, id->id);
camel_message_info_unref (clone);
camel_message_info_unref (info);
diff --git a/src/camel/camel-ews-summary.c b/src/camel/camel-ews-summary.c
index 971e902..1f10cb2 100644
--- a/src/camel/camel-ews-summary.c
+++ b/src/camel/camel-ews-summary.c
@@ -273,7 +273,7 @@ ews_info_set_flags (CamelMessageInfo *info,
return CAMEL_FOLDER_SUMMARY_CLASS (camel_ews_summary_parent_class)->info_set_flags (info, flags, set);
}
-void
+gboolean
camel_ews_summary_add_message (CamelFolderSummary *summary,
const gchar *uid,
const gchar *change_key,
@@ -284,13 +284,13 @@ camel_ews_summary_add_message (CamelFolderSummary *summary,
const CamelFlag *flag;
const CamelTag *tag;
- g_return_if_fail (uid != NULL);
- g_return_if_fail (info != NULL);
- g_return_if_fail (message != NULL);
+ g_return_val_if_fail (uid != NULL, FALSE);
+ g_return_val_if_fail (info != NULL, FALSE);
+ g_return_val_if_fail (message != NULL, FALSE);
/* Create summary entry */
mi = (CamelEwsMessageInfo *) camel_folder_summary_info_new_from_message (summary, message, NULL);
- g_return_if_fail (mi != NULL);
+ g_return_val_if_fail (mi != NULL, FALSE);
/* Set the change_key */
mi->change_key = g_strdup (change_key);
@@ -317,6 +317,8 @@ camel_ews_summary_add_message (CamelFolderSummary *summary,
camel_folder_summary_add (summary, (CamelMessageInfo *) mi);
camel_folder_summary_touch (summary);
camel_folder_summary_save_to_db (summary, NULL);
+
+ return TRUE;
}
static gboolean
diff --git a/src/camel/camel-ews-summary.h b/src/camel/camel-ews-summary.h
index b28d4e1..2d6cee1 100644
--- a/src/camel/camel-ews-summary.h
+++ b/src/camel/camel-ews-summary.h
@@ -88,7 +88,8 @@ gboolean
CamelMessageInfo *info,
guint32 server_flags,
CamelFlag *server_user_flags);
-void camel_ews_summary_add_message (CamelFolderSummary *summary,
+gboolean
+ camel_ews_summary_add_message (CamelFolderSummary *summary,
const gchar *uid,
const gchar *change_key,
CamelMessageInfo *info,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]