aboutsummaryrefslogtreecommitdiffstats
path: root/libemail-engine/e-mail-utils.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2013-03-05 21:14:31 +0800
committerMilan Crha <mcrha@redhat.com>2013-03-05 21:14:31 +0800
commit853abba1d383c27733c0fca23aaae165c30eea54 (patch)
tree589ba7fd64d75898477fcedf18d8f050aaf6b90f /libemail-engine/e-mail-utils.c
parent642eaed17fcc9aa6b8cbd5c0fcf8916e29ab39e3 (diff)
downloadgsoc2013-evolution-853abba1d383c27733c0fca23aaae165c30eea54.tar.gz
gsoc2013-evolution-853abba1d383c27733c0fca23aaae165c30eea54.tar.zst
gsoc2013-evolution-853abba1d383c27733c0fca23aaae165c30eea54.zip
Bug #693254 - Mail reply uses wrong "From:" account
Diffstat (limited to 'libemail-engine/e-mail-utils.c')
-rw-r--r--libemail-engine/e-mail-utils.c45
1 files changed, 35 insertions, 10 deletions
diff --git a/libemail-engine/e-mail-utils.c b/libemail-engine/e-mail-utils.c
index cc5ef7342e..7b406ec9ab 100644
--- a/libemail-engine/e-mail-utils.c
+++ b/libemail-engine/e-mail-utils.c
@@ -484,10 +484,12 @@ mail_account_in_recipients (ESourceRegistry *registry,
}
ESource *
-em_utils_guess_mail_account_with_recipients (ESourceRegistry *registry,
- CamelMimeMessage *message,
- CamelFolder *folder,
- const gchar *message_uid)
+em_utils_guess_mail_account_with_recipients_and_sort (ESourceRegistry *registry,
+ CamelMimeMessage *message,
+ CamelFolder *folder,
+ const gchar *message_uid,
+ EMailUtilsSourtSourcesFunc sort_func,
+ gpointer sort_func_data)
{
ESource *source = NULL;
GHashTable *recipients;
@@ -552,6 +554,9 @@ second_preference:
extension_name = E_SOURCE_EXTENSION_MAIL_ACCOUNT;
list = e_source_registry_list_sources (registry, extension_name);
+ if (sort_func)
+ sort_func (&list, sort_func_data);
+
for (iter = list; iter != NULL; iter = g_list_next (iter)) {
ESource *temp = E_SOURCE (iter->data);
@@ -578,10 +583,12 @@ exit:
}
ESource *
-em_utils_guess_mail_identity_with_recipients (ESourceRegistry *registry,
- CamelMimeMessage *message,
- CamelFolder *folder,
- const gchar *message_uid)
+em_utils_guess_mail_identity_with_recipients_and_sort (ESourceRegistry *registry,
+ CamelMimeMessage *message,
+ CamelFolder *folder,
+ const gchar *message_uid,
+ EMailUtilsSourtSourcesFunc sort_func,
+ gpointer sort_func_data)
{
ESource *source;
ESourceExtension *extension;
@@ -591,8 +598,8 @@ em_utils_guess_mail_identity_with_recipients (ESourceRegistry *registry,
g_return_val_if_fail (E_IS_SOURCE_REGISTRY (registry), NULL);
g_return_val_if_fail (CAMEL_IS_MIME_MESSAGE (message), NULL);
- source = em_utils_guess_mail_account_with_recipients (
- registry, message, folder, message_uid);
+ source = em_utils_guess_mail_account_with_recipients_and_sort (
+ registry, message, folder, message_uid, sort_func, sort_func_data);
if (source == NULL)
return NULL;
@@ -619,6 +626,24 @@ em_utils_guess_mail_identity_with_recipients (ESourceRegistry *registry,
}
ESource *
+em_utils_guess_mail_account_with_recipients (ESourceRegistry *registry,
+ CamelMimeMessage *message,
+ CamelFolder *folder,
+ const gchar *message_uid)
+{
+ return em_utils_guess_mail_account_with_recipients_and_sort (registry, message, folder, message_uid, NULL, NULL);
+}
+
+ESource *
+em_utils_guess_mail_identity_with_recipients (ESourceRegistry *registry,
+ CamelMimeMessage *message,
+ CamelFolder *folder,
+ const gchar *message_uid)
+{
+ return em_utils_guess_mail_identity_with_recipients_and_sort (registry, message, folder, message_uid, NULL, NULL);
+}
+
+ESource *
em_utils_ref_mail_identity_for_store (ESourceRegistry *registry,
CamelStore *store)
{