aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/em-utils.c11
-rw-r--r--modules/mail/e-mail-shell-sidebar.c4
2 files changed, 11 insertions, 4 deletions
diff --git a/mail/em-utils.c b/mail/em-utils.c
index 4ee9110ae5..76148f70ec 100644
--- a/mail/em-utils.c
+++ b/mail/em-utils.c
@@ -1413,12 +1413,21 @@ gboolean
em_utils_folder_is_outbox(CamelFolder *folder, const gchar *uri)
{
CamelFolder *local_outbox_folder;
+ const gchar *local_outbox_uri;
local_outbox_folder =
e_mail_local_get_folder (E_MAIL_FOLDER_OUTBOX);
/* <Highlander>There can be only one.</Highlander> */
- return folder == local_outbox_folder;
+ if (folder && folder == local_outbox_folder)
+ return TRUE;
+
+ if (!uri || !local_outbox_folder)
+ return FALSE;
+
+ local_outbox_uri = e_mail_local_get_folder_uri (E_MAIL_FOLDER_OUTBOX);
+
+ return camel_store_folder_uri_equal (local_outbox_folder->parent_store, local_outbox_uri, uri);
}
/**
diff --git a/modules/mail/e-mail-shell-sidebar.c b/modules/mail/e-mail-shell-sidebar.c
index 3db9bd674e..fcc6805514 100644
--- a/modules/mail/e-mail-shell-sidebar.c
+++ b/modules/mail/e-mail-shell-sidebar.c
@@ -501,7 +501,6 @@ mail_shell_sidebar_check_state (EShellSidebar *shell_sidebar)
GtkTreeView *tree_view;
GtkTreeModel *model;
GtkTreeIter iter;
- CamelFolder *folder;
CamelStore *local_store;
CamelStore *store;
gchar *full_name;
@@ -550,8 +549,7 @@ mail_shell_sidebar_check_state (EShellSidebar *shell_sidebar)
(strcmp (full_name, "Templates") != 0);
if (!(folder_flags & CAMEL_FOLDER_HAS_BEEN_DELETED)) {
- folder = em_folder_tree_get_selected_folder (folder_tree);
- is_outbox = em_utils_folder_is_outbox (folder, NULL);
+ is_outbox = em_utils_folder_is_outbox (NULL, uri);
}
can_delete &= !(folder_flags & CAMEL_FOLDER_SYSTEM);
}