Blob Blame History Raw
diff -up evolution-data-server-3.8.5/camel/camel-vee-folder.c.vfolder-update evolution-data-server-3.8.5/camel/camel-vee-folder.c
--- evolution-data-server-3.8.5/camel/camel-vee-folder.c.vfolder-update	2013-07-23 13:57:49.000000000 +0200
+++ evolution-data-server-3.8.5/camel/camel-vee-folder.c	2014-01-23 15:47:41.876982760 +0100
@@ -1708,6 +1708,30 @@ camel_vee_folder_ignore_next_changed_eve
 }
 
 /**
+ * camel_vee_folder_remove_from_ignore_changed_event:
+ * @vfolder: a #CamelVeeFolder
+ * @subfolder: a #CamelFolder folder
+ *
+ * Make sure the next @subfolder-'s 'changed' event will not be silently ignored.
+ * This is a counter-part function of camel_vee_folder_ignore_next_changed_event(),
+ * when there was expected a change, which did not happen, to take back the previous
+ * ignore event request.
+ *
+ * Since: 3.10.4
+ **/
+void
+camel_vee_folder_remove_from_ignore_changed_event (CamelVeeFolder *vfolder,
+						   CamelFolder *subfolder)
+{
+	g_return_if_fail (CAMEL_IS_VEE_FOLDER (vfolder));
+	g_return_if_fail (subfolder != NULL);
+
+	g_rec_mutex_lock (&vfolder->priv->changed_lock);
+	g_hash_table_remove (vfolder->priv->ignore_changed, subfolder);
+	g_rec_mutex_unlock (&vfolder->priv->changed_lock);
+}
+
+/**
  * camel_vee_folder_lock:
  * @folder: a #CamelVeeFolder
  * @lock: lock type to lock
diff -up evolution-data-server-3.8.5/camel/camel-vee-folder.h.vfolder-update evolution-data-server-3.8.5/camel/camel-vee-folder.h
--- evolution-data-server-3.8.5/camel/camel-vee-folder.h.vfolder-update	2013-07-23 13:57:53.000000000 +0200
+++ evolution-data-server-3.8.5/camel/camel-vee-folder.h	2014-01-23 15:47:41.876982760 +0100
@@ -141,6 +141,9 @@ const gchar *	camel_vee_folder_get_expre
 void		camel_vee_folder_ignore_next_changed_event
 							(CamelVeeFolder *vfolder,
 							 CamelFolder *subfolder);
+void		camel_vee_folder_remove_from_ignore_changed_event
+							(CamelVeeFolder *vfolder,
+							 CamelFolder *subfolder);
 
 void		camel_vee_folder_lock			(CamelVeeFolder *folder,
 							 CamelVeeFolderLock lock);
diff -up evolution-data-server-3.8.5/camel/camel-vee-summary.c.vfolder-update evolution-data-server-3.8.5/camel/camel-vee-summary.c
--- evolution-data-server-3.8.5/camel/camel-vee-summary.c.vfolder-update	2013-07-23 13:57:42.000000000 +0200
+++ evolution-data-server-3.8.5/camel/camel-vee-summary.c	2014-01-23 15:47:41.876982760 +0100
@@ -191,10 +191,14 @@ vee_info_set_user_flag (CamelMessageInfo
 
 		res = camel_message_info_set_user_flag (rmi, name, value);
 
-		camel_message_info_free (rmi);
+		if (ignore_changes) {
+			if (res)
+				vee_summary_notify_mi_changed (vf, mi);
+			else
+				camel_vee_folder_remove_from_ignore_changed_event (vf, camel_folder_summary_get_folder (rmi->summary));
+		}
 
-		if (ignore_changes)
-			vee_summary_notify_mi_changed (vf, mi);
+		camel_message_info_free (rmi);
 	}
 
 	return res;
@@ -220,10 +224,15 @@ vee_info_set_user_tag (CamelMessageInfo
 			camel_vee_folder_ignore_next_changed_event (vf, camel_folder_summary_get_folder (rmi->summary));
 
 		res = camel_message_info_set_user_tag (rmi, name, value);
-		camel_message_info_free (rmi);
 
-		if (ignore_changes)
-			vee_summary_notify_mi_changed (vf, mi);
+		if (ignore_changes) {
+			if (res)
+				vee_summary_notify_mi_changed (vf, mi);
+			else
+				camel_vee_folder_remove_from_ignore_changed_event (vf, camel_folder_summary_get_folder (rmi->summary));
+		}
+
+		camel_message_info_free (rmi);
 	}
 
 	return res;
@@ -259,10 +268,14 @@ vee_info_set_flags (CamelMessageInfo *mi
 			camel_folder_summary_replace_flags (mi->summary, mi);
 		}
 
-		camel_message_info_free (rmi);
+		if (ignore_changes) {
+			if (res)
+				vee_summary_notify_mi_changed (vf, mi);
+			else
+				camel_vee_folder_remove_from_ignore_changed_event (vf, camel_folder_summary_get_folder (rmi->summary));
+		}
 
-		if (ignore_changes)
-			vee_summary_notify_mi_changed (vf, mi);
+		camel_message_info_free (rmi);
 	}
 
 	/* Do not call parent class' info_set_flags, to not do flood