Total count on folder_update



Hi,

I think that tinymail is not updating correctly the total count of messages in a folder in folder_changed method of TnyCamelFolder. It only cares about the unread status. See the attached patch for the fix.

Br
Index: libtinymail-camel/tny-camel-folder.c
===================================================================
--- libtinymail-camel/tny-camel-folder.c	(revision 2979)
+++ libtinymail-camel/tny-camel-folder.c	(working copy)
@@ -351,6 +351,7 @@
 		summary = priv->folder->summary;
 
 		if (!change && info->uid_changed != NULL && info->uid_changed->len > 0) {
+			priv->cached_length = camel_folder_get_message_count (priv->folder);
 			priv->unread_length = camel_folder_get_unread_message_count (priv->folder);
 			urcnted = TRUE;
 			change = tny_folder_change_new (TNY_FOLDER (self));
@@ -359,6 +360,7 @@
 		if (info->uid_added && info->uid_added->len > 0) 
 		{
 			if (!urcnted) {
+				priv->cached_length = camel_folder_get_message_count (priv->folder);
 				priv->unread_length = camel_folder_get_unread_message_count (priv->folder);
 				urcnted = TRUE;
 			}
@@ -392,6 +394,7 @@
 		if (info->uid_removed && info->uid_removed->len > 0) 
 		{
 			if (!urcnted) {
+				priv->cached_length = camel_folder_get_message_count (priv->folder);
 				priv->unread_length = camel_folder_get_unread_message_count (priv->folder);
 				urcnted = TRUE;
 			}


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