From b490c7e42a2ca3f75426ec5c4052a658b722d06c Mon Sep 17 00:00:00 2001 From: 7 Date: Tue, 18 Sep 2001 21:44:47 +0000 Subject: Function to get the real receive tpe for ag iven url. IMAP/SPOOL/MAILDIR 2001-09-17 * mail-send-recv.c (get_receive_type): Function to get the real receive tpe for ag iven url. IMAP/SPOOL/MAILDIR types just update their info, dont download. (build_dialogue): (mail_receive_uri): Use function above to get the right receive type. svn path=/trunk/; revision=12957 --- mail/ChangeLog | 9 +++++++++ mail/mail-send-recv.c | 21 ++++++++++++--------- 2 files changed, 21 insertions(+), 9 deletions(-) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index 8a5fbc54eb..e5fae8ac50 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,12 @@ +2001-09-17 + + * mail-send-recv.c (get_receive_type): Function to get the real + receive tpe for ag iven url. IMAP/SPOOL/MAILDIR types just update + their info, dont download. + (build_dialogue): + (mail_receive_uri): Use function above to get the right receive + type. + 2001-09-18 Jeffrey Stedfast * mail-tools.c (mail_tool_remove_xevolution_headers): Oops, forgot diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c index 1baa28a866..0b5b187c05 100644 --- a/mail/mail-send-recv.c +++ b/mail/mail-send-recv.c @@ -250,6 +250,16 @@ format_url(const char *internal_url) return pretty_url; } +static send_info_t get_receive_type(const char *url) +{ + if (!strncmp(url, "imap:", 5) + || !strncmp(url, "spool:", 6) + || !strncmp(url, "maildir:", 8)) + return SEND_UPDATE; + else + return SEND_RECEIVE; +} + static struct _send_data * build_dialogue (GSList *sources, CamelFolder *outbox, const char *destination) { @@ -291,10 +301,7 @@ build_dialogue (GSList *sources, CamelFolder *outbox, const char *destination) if (info == NULL) { info = g_malloc0 (sizeof (*info)); /* imap and spool are handled differently */ - if (!strncmp (source->url, "imap:", 5) || !strncmp (source->url, "spool:", 6)) - info->type = SEND_UPDATE; - else - info->type = SEND_RECEIVE; + info->type = get_receive_type(source->url); d(printf("adding source %s\n", source->url)); info->uri = g_strdup (source->url); @@ -791,11 +798,7 @@ mail_receive_uri (const char *uri, int keep) info = g_malloc0 (sizeof (*info)); /* imap is handled differently */ - if (!strncmp (uri, "imap:", 5)) - info->type = SEND_UPDATE; - else - info->type = SEND_RECEIVE; - + info->type = get_receive_type(uri); info->bar = NULL; info->status = NULL; info->uri = g_strdup (uri); -- cgit v1.2.3