aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog4
-rw-r--r--mail/mail-config.c20
-rw-r--r--mail/mail-config.h1
3 files changed, 25 insertions, 0 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index bd3b27bd2d..41c4b9c2bf 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,5 +1,9 @@
2001-01-12 Jeffrey Stedfast <fejj@ximian.com>
+ * mail-config.c (mail_config_get_account_by_name): New convenience
+ function that I will need later when I redo the composer From
+ field.
+
* mail-display.c (on_object_requested): Update to reflect past
changes to the mail-config API.
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)
{
diff --git a/mail/mail-config.h b/mail/mail-config.h
index 5c40b832f2..cc8e9b7cbe 100644
--- a/mail/mail-config.h
+++ b/mail/mail-config.h
@@ -94,6 +94,7 @@ gint mail_config_get_mark_as_seen_timeout (void);
void mail_config_set_mark_as_seen_timeout (gint timeout);
const MailConfigAccount *mail_config_get_default_account (void);
+const MailConfigAccount *mail_config_get_account_by_name (const char *account_name);
const GSList *mail_config_get_accounts (void);
void mail_config_add_account (MailConfigAccount *account);
void mail_config_set_default_account (const MailConfigAccount *account);