[evolution] Bug #346146 - Appointments in Sent folder should not display actions



commit 4a2d5ee3455556cc5d61dac2f7fe87045a00b2b2
Author: Milan Crha <mcrha redhat com>
Date:   Fri Jun 19 16:21:08 2009 +0200

    Bug #346146 - Appointments in Sent folder should not display actions

 plugins/itip-formatter/itip-formatter.c |   28 ++++++++++++++++++++++++----
 1 files changed, 24 insertions(+), 4 deletions(-)
---
diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c
index ed406d9..558d514 100644
--- a/plugins/itip-formatter/itip-formatter.c
+++ b/plugins/itip-formatter/itip-formatter.c
@@ -35,6 +35,7 @@
 #include <camel/camel-mime-utils.h>
 #include <camel/camel-mime-message.h>
 #include <camel/camel-folder.h>
+#include <camel/camel-vee-folder.h>
 #include <camel/camel-multipart.h>
 #include <camel/camel-service.h>
 #include <camel/camel-store.h>
@@ -48,6 +49,7 @@
 #include <mail/em-format.h>
 #include <mail/em-format-html.h>
 #include <mail/em-utils.h>
+#include <mail/mail-folder-cache.h>
 #include <mail/mail-tools.h>
 #include <mail/mail-mt.h>
 #include <libedataserver/e-account-list.h>
@@ -2019,6 +2021,7 @@ static gboolean
 in_proper_folder (CamelFolder *folder)
 {
 	gboolean res = TRUE;
+	gint flags = 0;
 	gchar *uri;
 
 	if (!folder)
@@ -2026,10 +2029,27 @@ in_proper_folder (CamelFolder *folder)
 
 	uri = mail_tools_folder_to_url (folder);
 
-	res = !(folder->folder_flags & CAMEL_FOLDER_IS_TRASH) &&
-	      !em_utils_folder_is_sent (folder, uri) &&
-	      !em_utils_folder_is_outbox (folder, uri) &&
-	      !em_utils_folder_is_drafts (folder, uri);
+	if (mail_folder_cache_get_folder_info_flags (folder, &flags)) {
+		/* it should be neither trash nor junk folder, */
+		res = ((flags & CAMEL_FOLDER_TYPE_TRASH) !=  CAMEL_FOLDER_TYPE_TRASH &&
+		       (flags & CAMEL_FOLDER_TYPE_JUNK) != CAMEL_FOLDER_TYPE_JUNK &&
+			  /* it can be Inbox */
+			( (flags & CAMEL_FOLDER_TYPE_INBOX) == CAMEL_FOLDER_TYPE_INBOX ||
+			  /* or any other virtual folder */
+			  CAMEL_IS_VEE_FOLDER (folder) ||
+			  /* or anything else except of sent, outbox or drafts folder */
+			  (!em_utils_folder_is_sent (folder, uri) &&
+			   !em_utils_folder_is_outbox (folder, uri) &&
+			   !em_utils_folder_is_drafts (folder, uri))
+			));
+	} else {
+		/* cannot check for Inbox folder here */
+		res = (folder->folder_flags & (CAMEL_FOLDER_IS_TRASH | CAMEL_FOLDER_IS_JUNK)) == 0 && (
+		      (CAMEL_IS_VEE_FOLDER (folder)) || (
+		      !em_utils_folder_is_sent (folder, uri) &&
+		      !em_utils_folder_is_outbox (folder, uri) &&
+		      !em_utils_folder_is_drafts (folder, uri)));
+	}
 
 	g_free (uri);
 



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