From 07b7de2790baef043522d430d12d5da08a3bd162 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 7 Aug 2013 17:04:47 +0200 Subject: [PATCH] CamelIMAPXServer: Handle unsolicited VANISHED responses. By "unsolicited" here I mean there are no commands in progress which would otherwise emit the folder change notification when the command completes. In that situation, emit the change notification directly from imapx_untagged_vanished() rather than holding it until the next command completes. --- camel/camel-imapx-server.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/camel/camel-imapx-server.c b/camel/camel-imapx-server.c index 00c9545..e3398ee 100644 --- a/camel/camel-imapx-server.c +++ b/camel/camel-imapx-server.c @@ -1620,6 +1620,15 @@ imapx_untagged_vanished (CamelIMAPXServer *is, uid_list = g_list_reverse (uid_list); camel_folder_summary_remove_uids (folder->summary, uid_list); + /* If the response is truly unsolicited (e.g. via NOTIFY) + * then go ahead and emit the change notification now. */ + if (camel_imapx_command_queue_is_empty (is->queue)) { + camel_folder_summary_save_to_db (folder->summary, NULL); + imapx_update_store_summary (folder); + camel_folder_changed (folder, is->changes); + camel_folder_change_info_clear (is->changes); + } + g_list_free_full (uid_list, (GDestroyNotify) g_free); g_ptr_array_free (uids, TRUE); -- 2.7.4