aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-config.c
diff options
context:
space:
mode:
authorJon Trowbridge <trow@ximian.com>2001-03-30 07:46:55 +0800
committerJon Trowbridge <trow@src.gnome.org>2001-03-30 07:46:55 +0800
commit424506262d215dfe306aea0d0fe86833d08b82a4 (patch)
treeeb1a374e5b456d1d546b0c0f4b5a4d0d6280a7de /mail/mail-config.c
parentb912dd5436413b55dc4500dd7d2b8afcdd433727 (diff)
downloadgsoc2013-evolution-424506262d215dfe306aea0d0fe86833d08b82a4.tar.gz
gsoc2013-evolution-424506262d215dfe306aea0d0fe86833d08b82a4.tar.zst
gsoc2013-evolution-424506262d215dfe306aea0d0fe86833d08b82a4.zip
Added #include <libgnome/gnome-paper.h>
2001-03-29 Jon Trowbridge <trow@ximian.com> * printing/e-contact-print.c: Added #include <libgnome/gnome-paper.h> * printing/e-contact-print-envelope.c: Added #include <time.h> and #include <libgnome/gnome-paper.h> * gui/component/select-names/e-select-names-completion.c (match_email): Better handle matching of "nameless" contacts. * backend/ebook/e-destination.c (e_destination_get_string): Better handle the case of a "nameless" contact. 2001-03-29 Jon Trowbridge <trow@ximian.com> * camel-filter-driver.c (camel_filter_driver_filter_message): Save the source URL using camel_mime_message_set_source. * camel-mime-message.c (camel_mime_message_set_source): Renamed camel_mime_message_set_identity to this. Sets the X-Evolution-Source header. (camel_mime_message_get_source): Returns the X-Evolution-Source header. 2001-03-29 Jon Trowbridge <trow@ximian.com> * mail-callbacks.c: Added #include <time.h> to get things to compile. * mail-callbacks.c (mail_generate_reply): Look at the X-Evolution-Source header, and try to find a corresponding account. If this works, send the mail from this account. If not, use the default account. * mail-ops.c (send_queue_send): Strip out the X-Evolution-Source header before sending. * mail-config.c (mail_config_get_account_by_source_url): Added. Look up accounts by source URL. svn path=/trunk/; revision=9032
Diffstat (limited to 'mail/mail-config.c')
-rw-r--r--mail/mail-config.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/mail/mail-config.c b/mail/mail-config.c
index be685ba180..38d84fc0e7 100644
--- a/mail/mail-config.c
+++ b/mail/mail-config.c
@@ -772,6 +772,38 @@ mail_config_get_account_by_name (const char *account_name)
return NULL;
}
+/*
+ We do a strncmp on the MIN of the url lengths rather than a straight strcmp because
+ I've observed extra stuff getting stuck on the end of urls in camel. Hopefully
+ this work-around won't lead to any weirdness.
+*/
+
+const MailConfigAccount *
+mail_config_get_account_by_source_url (const char *source_url)
+{
+ const MailConfigAccount *account;
+ GSList *l;
+ gint src_len;
+
+ g_return_val_if_fail (source_url != NULL, NULL);
+
+ src_len = strlen (source_url);
+
+ l = config->accounts;
+ while (l) {
+ account = l->data;
+ if (account
+ && account->source
+ && account->source->url
+ && !strncmp (account->source->url, source_url, MIN (src_len, strlen (account->source->url))))
+ return account;
+
+ l = l->next;
+ }
+
+ return NULL;
+}
+
const GSList *
mail_config_get_accounts (void)
{