From 4a2d5ee3455556cc5d61dac2f7fe87045a00b2b2 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 19 Jun 2009 16:21:08 +0200 Subject: Bug #346146 - Appointments in Sent folder should not display actions --- plugins/itip-formatter/itip-formatter.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c index ed406d9bd2..558d514f86 100644 --- a/plugins/itip-formatter/itip-formatter.c +++ b/plugins/itip-formatter/itip-formatter.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -48,6 +49,7 @@ #include #include #include +#include #include #include #include @@ -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); -- cgit v1.2.3