aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-config.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@helixcode.com>2001-01-13 05:15:36 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-01-13 05:15:36 +0800
commit7b02bff8210ca98f1d3ff0720091b512602571e8 (patch)
treeb8d018aed6389006e17678e6ff8929ba1c012992 /mail/mail-config.c
parent8ad2b343a02b954f2393e08deece19861352329e (diff)
downloadgsoc2013-evolution-7b02bff8210ca98f1d3ff0720091b512602571e8.tar
gsoc2013-evolution-7b02bff8210ca98f1d3ff0720091b512602571e8.tar.gz
gsoc2013-evolution-7b02bff8210ca98f1d3ff0720091b512602571e8.tar.bz2
gsoc2013-evolution-7b02bff8210ca98f1d3ff0720091b512602571e8.tar.lz
gsoc2013-evolution-7b02bff8210ca98f1d3ff0720091b512602571e8.tar.xz
gsoc2013-evolution-7b02bff8210ca98f1d3ff0720091b512602571e8.tar.zst
gsoc2013-evolution-7b02bff8210ca98f1d3ff0720091b512602571e8.zip
Get the account by using the new e_msg_composer_get_preferred_account()
2001-01-12 Jeffrey Stedfast <fejj@helixcode.com> * mail-callbacks.c (composer_send_cb): Get the account by using the new e_msg_composer_get_preferred_account() function. Also check to make sure everything is configured (in case they deleted their accounts while composing mail?). * mail-config.c (mail_config_get_account_by_address): New convenience function. svn path=/trunk/; revision=7459
Diffstat (limited to 'mail/mail-config.c')
-rw-r--r--mail/mail-config.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/mail/mail-config.c b/mail/mail-config.c
index c5ba93f4a1..6ba5f1b51e 100644
--- a/mail/mail-config.c
+++ b/mail/mail-config.c
@@ -542,7 +542,26 @@ mail_config_get_account_by_name (const char *account_name)
l = config->accounts;
while (l) {
account = l->data;
- if (!strcmp (account->name, account_name))
+ if (account && !strcmp (account->name, account_name))
+ return account;
+
+ l = l->next;
+ }
+
+ return NULL;
+}
+
+const MailConfigAccount *
+mail_config_get_account_by_address (const char *address)
+{
+ /* FIXME: this should really use a hash? */
+ const MailConfigAccount *account;
+ GSList *l;
+
+ l = config->accounts;
+ while (l) {
+ account = l->data;
+ if (account && account->id && !g_strcasecmp (account->id->address, address))
return account;
l = l->next;