aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
Diffstat (limited to 'mail')
-rw-r--r--mail/e-mail-paned-view.c2
-rw-r--r--mail/e-mail-reader-utils.c2
-rw-r--r--mail/e-mail-reader.c2
-rw-r--r--mail/em-utils.c18
-rw-r--r--mail/em-utils.h2
-rw-r--r--mail/mail-folder-cache.c3
6 files changed, 15 insertions, 14 deletions
diff --git a/mail/e-mail-paned-view.c b/mail/e-mail-paned-view.c
index 06da0a02dd..dc51615a53 100644
--- a/mail/e-mail-paned-view.c
+++ b/mail/e-mail-paned-view.c
@@ -784,7 +784,7 @@ mail_paned_view_update_view_instance (EMailView *view)
outgoing_folder =
em_utils_folder_is_drafts (folder) ||
em_utils_folder_is_outbox (folder, folder_uri) ||
- em_utils_folder_is_sent (folder, folder_uri);
+ em_utils_folder_is_sent (folder);
if (e_shell_settings_get_boolean (shell_settings, "mail-global-view-setting"))
view_instance = e_shell_view_new_view_instance (shell_view, outgoing_folder ? "global_view_sent_setting" : "global_view_setting");
diff --git a/mail/e-mail-reader-utils.c b/mail/e-mail-reader-utils.c
index 70bd53daba..af8b2280cf 100644
--- a/mail/e-mail-reader-utils.c
+++ b/mail/e-mail-reader-utils.c
@@ -552,7 +552,7 @@ e_mail_reader_create_filter_from_selected (EMailReader *reader,
folder = e_mail_reader_get_folder (reader);
folder_uri = e_mail_reader_get_folder_uri (reader);
- if (em_utils_folder_is_sent (folder, folder_uri))
+ if (em_utils_folder_is_sent (folder))
filter_source = E_FILTER_SOURCE_OUTGOING;
else if (em_utils_folder_is_outbox (folder, folder_uri))
filter_source = E_FILTER_SOURCE_OUTGOING;
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index c3ad3165ed..4e84b6c1fb 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -2932,7 +2932,7 @@ mail_reader_set_folder (EMailReader *reader,
outgoing = folder != NULL && folder_uri != NULL && (
em_utils_folder_is_drafts (folder) ||
em_utils_folder_is_outbox (folder, folder_uri) ||
- em_utils_folder_is_sent (folder, folder_uri));
+ em_utils_folder_is_sent (folder));
/* FIXME Need to pass a GCancellable. */
em_format_format (EM_FORMAT (formatter), NULL, NULL, NULL, NULL);
diff --git a/mail/em-utils.c b/mail/em-utils.c
index 86b6b812b1..5c8082d6e2 100644
--- a/mail/em-utils.c
+++ b/mail/em-utils.c
@@ -1113,22 +1113,24 @@ em_utils_folder_is_drafts (CamelFolder *folder)
/**
* em_utils_folder_is_sent:
- * @folder: folder
- * @uri: uri for this folder, if known
+ * @folder: a #CamelFolder
*
- * Decides if @folder is a Sent folder
+ * Decides if @folder is a Sent folder.
*
* Returns %TRUE if this is a Sent folder or %FALSE otherwise.
**/
gboolean
-em_utils_folder_is_sent (CamelFolder *folder, const gchar *uri)
+em_utils_folder_is_sent (CamelFolder *folder)
{
CamelFolder *local_sent_folder;
CamelSession *session;
CamelStore *store;
EAccountList *account_list;
EIterator *iterator;
- gint is_sent = FALSE;
+ gchar *folder_uri;
+ gboolean is_sent = FALSE;
+
+ g_return_val_if_fail (CAMEL_IS_FOLDER (folder), FALSE);
local_sent_folder =
e_mail_local_get_folder (E_MAIL_LOCAL_FOLDER_SENT);
@@ -1136,8 +1138,7 @@ em_utils_folder_is_sent (CamelFolder *folder, const gchar *uri)
if (folder == local_sent_folder)
return TRUE;
- if (folder == NULL || uri == NULL)
- return FALSE;
+ folder_uri = e_mail_folder_uri_from_folder (folder);
store = camel_folder_get_parent_store (folder);
session = camel_service_get_session (CAMEL_SERVICE (store));
@@ -1157,7 +1158,7 @@ em_utils_folder_is_sent (CamelFolder *folder, const gchar *uri)
sent_uri = em_uri_to_camel (
account->sent_folder_uri);
is_sent = e_mail_folder_uri_equal (
- session, sent_uri, uri);
+ session, sent_uri, folder_uri);
g_free (sent_uri);
}
@@ -1165,6 +1166,7 @@ em_utils_folder_is_sent (CamelFolder *folder, const gchar *uri)
}
g_object_unref (iterator);
+ g_free (folder_uri);
return is_sent;
}
diff --git a/mail/em-utils.h b/mail/em-utils.h
index 069acb94fb..5ede20792b 100644
--- a/mail/em-utils.h
+++ b/mail/em-utils.h
@@ -64,7 +64,7 @@ void em_utils_selection_get_urilist (GtkSelectionData *data, CamelFolder *folder
gboolean em_utils_folder_is_drafts (CamelFolder *folder);
gboolean em_utils_folder_is_templates (CamelFolder *folder);
-gboolean em_utils_folder_is_sent (CamelFolder *folder, const gchar *uri);
+gboolean em_utils_folder_is_sent (CamelFolder *folder);
gboolean em_utils_folder_is_outbox (CamelFolder *folder, const gchar *uri);
gchar *em_utils_get_proxy_uri (const gchar *uri);
diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c
index c23030bdb4..5dde558b37 100644
--- a/mail/mail-folder-cache.c
+++ b/mail/mail-folder-cache.c
@@ -267,8 +267,7 @@ update_1folder (MailFolderCache *self,
|| (is_drafts = em_utils_folder_is_drafts (folder))
|| (is_outbox = em_utils_folder_is_outbox (
folder, info ? info->uri : NULL))
- || (self->priv->count_sent && em_utils_folder_is_sent (
- folder, info ? info->uri : NULL))) {
+ || (self->priv->count_sent && em_utils_folder_is_sent (folder))) {
d(printf(" total count\n"));
unread = camel_folder_get_message_count (folder);
if (is_drafts || is_outbox) {