aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-config.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/mail-config.c')
-rw-r--r--mail/mail-config.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/mail/mail-config.c b/mail/mail-config.c
index f238207d79..c5ba93f4a1 100644
--- a/mail/mail-config.c
+++ b/mail/mail-config.c
@@ -521,6 +521,7 @@ mail_config_get_default_account (void)
account = l->data;
if (account->default_account)
return account;
+
l = l->next;
}
@@ -531,6 +532,25 @@ mail_config_get_default_account (void)
return account;
}
+const MailConfigAccount *
+mail_config_get_account_by_name (const char *account_name)
+{
+ /* FIXME: this should really use a hash */
+ const MailConfigAccount *account;
+ GSList *l;
+
+ l = config->accounts;
+ while (l) {
+ account = l->data;
+ if (!strcmp (account->name, account_name))
+ return account;
+
+ l = l->next;
+ }
+
+ return NULL;
+}
+
const GSList *
mail_config_get_accounts (void)
{