From 0af3e545203107534c7dac6dae0c8f7a009a7fe3 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Thu, 22 Feb 2001 23:25:40 +0000 Subject: Only allow downloading if the source is enabled at this time. 2001-02-23 Not Zed * mail-send-recv.c (build_dialogue): Only allow downloading if the source is enabled at this time. (mail_autoreceive_setup): Check for enabled sources before setting up autodownload. * mail-vtrash.c (get_trash_free): Free store if we have it. (get_trash_got): Move vtrash add into here, so we execute in the right thread. svn path=/trunk/; revision=8354 --- mail/ChangeLog | 10 ++++++++++ mail/mail-send-recv.c | 5 +++-- mail/mail-vtrash.c | 16 +++++++++++----- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index 08b4a4be9b..4863495dac 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,10 @@ +2001-02-23 Not Zed + + * mail-send-recv.c (build_dialogue): Only allow downloading if the + source is enabled at this time. + (mail_autoreceive_setup): Check for enabled sources before setting + up autodownload. + 2001-02-22 Jeffrey Stedfast * mail-accounts.c (construct): Construct the PGP Path @@ -15,6 +22,9 @@ * mail-vtrash.c (get_trash_get): Setup the operation registration, and create a pseudo "start/stop" operation. + (get_trash_free): Free store if we have it. + (get_trash_got): Move vtrash add into here, so we execute in the + right thread. * component-factory.c (owner_set_cb): Make trash creation async. diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c index 299a07289a..c037568d24 100644 --- a/mail/mail-send-recv.c +++ b/mail/mail-send-recv.c @@ -228,7 +228,8 @@ static struct _send_data *build_dialogue(GSList *sources, CamelFolder *outbox, c while (sources) { MailConfigService *source = sources->data; - if (!source->url) { + if (!source->url + || !source->enabled) { sources = sources->next; continue; } @@ -695,7 +696,7 @@ mail_autoreceive_setup(void) while (sources) { MailConfigService *source = sources->data; - if (source->url && source->auto_check) { + if (source->url && source->auto_check && source->enabled) { struct _auto_data *info; printf("setting up auto-receive mail for : %s\n", source->url); diff --git a/mail/mail-vtrash.c b/mail/mail-vtrash.c index 207e72ef06..b83a7d7c32 100644 --- a/mail/mail-vtrash.c +++ b/mail/mail-vtrash.c @@ -120,7 +120,8 @@ vtrash_add (CamelStore *store, CamelFolder *folder, const char *store_uri, const struct _get_trash_msg { struct _mail_msg msg; - + + CamelStore *store; char *store_uri; CamelFolder *folder; void (*done) (char *store_uri, CamelFolder *folder, void *data); @@ -214,8 +215,8 @@ get_trash_get (struct _mail_msg *mm) urls = g_ptr_array_new (); /* we don't want to connect */ - store = (CamelStore *) camel_session_get_service (session, m->store_uri, - CAMEL_PROVIDER_STORE, &mm->ex); + m->store = store = (CamelStore *) camel_session_get_service (session, m->store_uri, + CAMEL_PROVIDER_STORE, &mm->ex); if (store == NULL) { g_warning ("Couldn't get service %s: %s\n", m->store_uri, camel_exception_get_description (&mm->ex)); @@ -239,7 +240,6 @@ get_trash_get (struct _mail_msg *mm) camel_store_free_folder_info (store, info); m->folder = create_trash_vfolder (_("vTrash"), urls, &mm->ex); - vtrash_add (store, m->folder, m->store_uri, _("vTrash")); } } @@ -251,6 +251,9 @@ static void get_trash_got (struct _mail_msg *mm) { struct _get_trash_msg *m = (struct _get_trash_msg *)mm; + + if (m->store) + vtrash_add (m->store, m->folder, m->store_uri, _("vTrash")); if (m->done) m->done (m->store_uri, m->folder, m->data); @@ -260,7 +263,10 @@ static void get_trash_free (struct _mail_msg *mm) { struct _get_trash_msg *m = (struct _get_trash_msg *)mm; - + + if (m->store) + camel_object_unref (CAMEL_OBJECT (m->store)); + g_free (m->store_uri); if (m->folder) camel_object_unref (CAMEL_OBJECT (m->folder)); -- cgit v1.2.3