diff options
author | Milan Crha <mcrha@redhat.com> | 2009-10-16 03:02:42 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2009-10-16 03:02:42 +0800 |
commit | f74a1448947259f52293ba922b64b2b3b8ff726c (patch) | |
tree | a85e893277db5a7564ba2857f87b8f256227f06d /mail | |
parent | 3766e19a2aafccaae1f662bc8770f074fdcc4a2d (diff) | |
download | gsoc2013-evolution-f74a1448947259f52293ba922b64b2b3b8ff726c.tar.gz gsoc2013-evolution-f74a1448947259f52293ba922b64b2b3b8ff726c.tar.zst gsoc2013-evolution-f74a1448947259f52293ba922b64b2b3b8ff726c.zip |
Bug #322261 - vCalendar replies are sent out using the default account
Diffstat (limited to 'mail')
-rw-r--r-- | mail/em-composer-utils.c | 34 | ||||
-rw-r--r-- | mail/em-utils.c | 38 | ||||
-rw-r--r-- | mail/em-utils.h | 2 |
3 files changed, 42 insertions, 32 deletions
diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c index 33972e1222..81055d1ab0 100644 --- a/mail/em-composer-utils.c +++ b/mail/em-composer-utils.c @@ -1844,19 +1844,6 @@ reply_get_composer (CamelMimeMessage *message, EAccount *account, } static EAccount * -guess_account_folder(CamelFolder *folder) -{ - EAccount *account; - gchar *tmp; - - tmp = camel_url_to_string(CAMEL_SERVICE(folder->parent_store)->url, CAMEL_URL_HIDE_ALL); - account = mail_config_get_account_by_source_url(tmp); - g_free(tmp); - - return account; -} - -static EAccount * guess_account (CamelMimeMessage *message, CamelFolder *folder) { GHashTable *account_hash = NULL; @@ -1868,27 +1855,10 @@ guess_account (CamelMimeMessage *message, CamelFolder *folder) CAMEL_RECIPIENT_TYPE_CC }; - /* check for newsgroup header */ - if (folder - && camel_medium_get_header((CamelMedium *)message, "Newsgroups") - && (account = guess_account_folder(folder))) + account = em_utils_guess_account (message, folder); + if (account) return account; - /* check for source folder */ - if (folder) { - account = guess_account_folder(folder); - if (account) - return account; - } - - /* then message source */ - if (account == NULL - && (tmp = camel_mime_message_get_source(message))) { - account = mail_config_get_account_by_source_url(tmp); - if (account) - return account; - } - /* finally recipient (to/cc) in account table */ account_hash = generate_account_hash (); for (j=0;account == NULL && j<2;j++) { diff --git a/mail/em-utils.c b/mail/em-utils.c index 79b11bc031..6198fbde40 100644 --- a/mail/em-utils.c +++ b/mail/em-utils.c @@ -2254,3 +2254,41 @@ em_utils_url_unescape_amp (const gchar *url) return buff; } + +static EAccount * +guess_account_folder (CamelFolder *folder) +{ + EAccount *account; + gchar *tmp; + + tmp = camel_url_to_string (CAMEL_SERVICE (folder->parent_store)->url, CAMEL_URL_HIDE_ALL); + account = mail_config_get_account_by_source_url (tmp); + g_free (tmp); + + return account; +} + +EAccount * +em_utils_guess_account (CamelMimeMessage *message, CamelFolder *folder) +{ + EAccount *account = NULL; + const gchar *tmp; + + /* check for newsgroup header */ + if (folder + && camel_medium_get_header ((CamelMedium *)message, "Newsgroups") + && (account = guess_account_folder (folder))) + return account; + + /* check for source folder */ + if (folder) + account = guess_account_folder (folder); + + /* then message source */ + if (account == NULL + && (tmp = camel_mime_message_get_source (message))) { + account = mail_config_get_account_by_source_url (tmp); + } + + return account; +} diff --git a/mail/em-utils.h b/mail/em-utils.h index 0c6a00bf6c..09a1a5dee0 100644 --- a/mail/em-utils.h +++ b/mail/em-utils.h @@ -110,6 +110,8 @@ void em_utils_clear_get_password_canceled_accounts_flag (void); /* Unescapes & back to a real & in URIs */ gchar *em_utils_url_unescape_amp (const gchar *url); +struct _EAccount *em_utils_guess_account (CamelMimeMessage *message, CamelFolder *folder); + G_END_DECLS #endif /* __EM_UTILS_H__ */ |