Fixed some bugs in folder observer notifications



This patch fixs some bugs found on folder observr notifications. It 
include to folder change header of added message. In merge-folder 
implementaiton, i found a bug in update function; added headers were
adding to original change, rather than new change to propagate it.

Thanks.

Index: libtinymail-camel/tny-camel-folder.c
===================================================================
--- libtinymail-camel/tny-camel-folder.c	(revision 2680)
+++ libtinymail-camel/tny-camel-folder.c	(working copy)
@@ -822,11 +822,17 @@
 	TnyFolder *self = info->self;
 	TnyCamelFolderPriv *priv = TNY_CAMEL_FOLDER_GET_PRIVATE (self);
 	TnyFolderChange *change = info->change;
+	TnyHeader *header = NULL;
 
 	if (change)
 	{
 		tny_folder_change_set_new_all_count (change, priv->cached_length);
 		tny_folder_change_set_new_unread_count (change, priv->unread_length);
+
+		header = tny_msg_get_header (info->adding_msg);
+		tny_folder_change_add_added_header (change, header);
+		g_object_unref (header);
+
 		notify_folder_observers_about (self, change);
 		g_object_unref (change);
 	}
Index: libtinymail/tny-merge-folder.c
===================================================================
--- libtinymail/tny-merge-folder.c	(revision 2680)
+++ libtinymail/tny-merge-folder.c	(working copy)
@@ -1297,7 +1297,7 @@
 		while (!tny_iterator_is_done (iter))
 		{
 			TnyHeader *header = TNY_HEADER (tny_iterator_get_current (iter));
-			tny_folder_change_add_added_header (change, header);
+			tny_folder_change_add_added_header (new_change, header);
 			g_object_unref (header);
 			tny_iterator_next (iter);
 		}


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