aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/itip-formatter
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2009-06-19 22:21:08 +0800
committerMilan Crha <mcrha@redhat.com>2009-06-19 22:21:08 +0800
commit4a2d5ee3455556cc5d61dac2f7fe87045a00b2b2 (patch)
tree7e567d4df2dde5b2bb502340d400d697123d0fe4 /plugins/itip-formatter
parentbbdb03cc99a393667636c371a04413b0fd4710ec (diff)
downloadgsoc2013-evolution-4a2d5ee3455556cc5d61dac2f7fe87045a00b2b2.tar.gz
gsoc2013-evolution-4a2d5ee3455556cc5d61dac2f7fe87045a00b2b2.tar.zst
gsoc2013-evolution-4a2d5ee3455556cc5d61dac2f7fe87045a00b2b2.zip
Bug #346146 - Appointments in Sent folder should not display actions
Diffstat (limited to 'plugins/itip-formatter')
-rw-r--r--plugins/itip-formatter/itip-formatter.c28
1 files 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 <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);