evolution-data-server r9233 - trunk/camel/providers/groupwise



Author: psankar
Date: Thu Jul 31 05:49:23 2008
New Revision: 9233
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=9233&view=rev

Log:
2008-07-31  Sankar P  <psankar novell com>

	* camel-groupwise-summary.c (gw_info_set_flags):
	Fix (un)read, deleted count issues.




Modified:
   trunk/camel/providers/groupwise/ChangeLog
   trunk/camel/providers/groupwise/camel-groupwise-summary.c

Modified: trunk/camel/providers/groupwise/camel-groupwise-summary.c
==============================================================================
--- trunk/camel/providers/groupwise/camel-groupwise-summary.c	(original)
+++ trunk/camel/providers/groupwise/camel-groupwise-summary.c	Thu Jul 31 05:49:23 2008
@@ -374,8 +374,27 @@
 	mi->flags = (old & ~flags) | (set & flags);
 	if (old != mi->flags) {
 		mi->flags |= CAMEL_MESSAGE_FOLDER_FLAGGED;
-		if (mi->summary)
-			camel_folder_summary_touch(mi->summary);
+
+		if (mi->summary) {
+
+				if ((set & CAMEL_MESSAGE_SEEN) && !(old & CAMEL_MESSAGE_SEEN)) {
+						mi->summary->unread_count -- ;
+				} else if ( (!(set & CAMEL_MESSAGE_SEEN)) && (old & CAMEL_MESSAGE_SEEN) ) {
+						mi->summary->unread_count ++ ;
+				}
+
+				if ((flags & CAMEL_MESSAGE_DELETED) && !(old & CAMEL_MESSAGE_DELETED)) {
+						mi->summary->deleted_count ++ ;
+
+						#warning "What to do when the user has set to show-deleted-messages "
+						mi->summary->visible_count -- ;
+
+						if (!(flags & CAMEL_MESSAGE_SEEN))
+							mi->summary->unread_count -- ;
+				}
+
+				camel_folder_summary_touch(mi->summary);
+		}
 	}
 	/* This is a hack, we are using CAMEL_MESSAGE_JUNK justo to hide the item
 	 * we make sure this doesn't have any side effects*/



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