aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-send-recv.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2003-05-01 10:19:46 +0800
committerMichael Zucci <zucchi@src.gnome.org>2003-05-01 10:19:46 +0800
commitd5ab5576f228051f358d2b8720df00281a882021 (patch)
tree70c67aac479089e07156aa0e73ab83f361a34588 /mail/mail-send-recv.c
parentf2a740bdaa100a4abf1ebb52392a42651d803414 (diff)
downloadgsoc2013-evolution-d5ab5576f228051f358d2b8720df00281a882021.tar
gsoc2013-evolution-d5ab5576f228051f358d2b8720df00281a882021.tar.gz
gsoc2013-evolution-d5ab5576f228051f358d2b8720df00281a882021.tar.bz2
gsoc2013-evolution-d5ab5576f228051f358d2b8720df00281a882021.tar.lz
gsoc2013-evolution-d5ab5576f228051f358d2b8720df00281a882021.tar.xz
gsoc2013-evolution-d5ab5576f228051f358d2b8720df00281a882021.tar.zst
gsoc2013-evolution-d5ab5576f228051f358d2b8720df00281a882021.zip
** See bug #41748
2003-04-30 Not Zed <NotZed@Ximian.com> ** See bug #41748 * mail-send-recv.c (build_dialogue): make sure we dont add any SEND_SEND types to the receive table. When we add the SEND_SEND type, key it on a fixed string SEND_URI_KEY. (receive_done): if it is a SEND_SEND type, use SEND_URI_KEY to remove it from the active list. (mail_receive_uri): make sure we never add a SEND_SEND type to the receive list. (mail_send): key the send info on SEND_URI_KEY not transport url. svn path=/trunk/; revision=21038
Diffstat (limited to 'mail/mail-send-recv.c')
-rw-r--r--mail/mail-send-recv.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c
index 2a2cd1ddf0..51d5949e7a 100644
--- a/mail/mail-send-recv.c
+++ b/mail/mail-send-recv.c
@@ -57,6 +57,9 @@
/* ms between status updates to the gui */
#define STATUS_TIMEOUT (250)
+/* pseudo-uri to key the send task on */
+#define SEND_URI_KEY "send-task:"
+
/* send/receive email */
/* ********************************************************************** */
@@ -347,7 +350,7 @@ build_dialogue (EAccountList *accounts, CamelFolder *outbox, const char *destina
send_info_t type;
type = get_receive_type (source->url);
- if (type == SEND_INVALID) {
+ if (type == SEND_INVALID || type == SEND_SEND) {
e_iterator_next (iter);
continue;
}
@@ -413,7 +416,7 @@ build_dialogue (EAccountList *accounts, CamelFolder *outbox, const char *destina
gtk_widget_show_all (GTK_WIDGET (table));
if (outbox && destination) {
- info = g_hash_table_lookup (data->active, destination);
+ info = g_hash_table_lookup (data->active, SEND_URI_KEY);
if (info == NULL) {
info = g_malloc0 (sizeof (*info));
info->type = SEND_SEND;
@@ -425,7 +428,7 @@ build_dialogue (EAccountList *accounts, CamelFolder *outbox, const char *destina
info->state = SEND_ACTIVE;
info->timeout_id = gtk_timeout_add (STATUS_TIMEOUT, operation_status_timeout, info);
- g_hash_table_insert (data->active, info->uri, info);
+ g_hash_table_insert (data->active, SEND_URI_KEY, info);
list = g_list_prepend (list, info);
} else if (info->timeout_id == 0)
info->timeout_id = gtk_timeout_add (STATUS_TIMEOUT, operation_status_timeout, info);
@@ -583,7 +586,10 @@ receive_done (char *uri, void *data)
/* remove/free this active download */
d(printf("%s: freeing info %p\n", G_GNUC_FUNCTION, info));
- g_hash_table_remove(info->data->active, info->uri);
+ if (info->type == SEND_SEND)
+ g_hash_table_remove(info->data->active, SEND_URI_KEY);
+ else
+ g_hash_table_remove(info->data->active, info->uri);
info->data->infos = g_list_remove(info->data->infos, info);
if (g_hash_table_size(info->data->active) == 0) {
@@ -853,7 +859,7 @@ mail_receive_uri (const char *uri, int keep)
d(printf("starting non-interactive download of '%s'\n", uri));
type = get_receive_type (uri);
- if (type == SEND_INVALID) {
+ if (type == SEND_INVALID || type == SEND_SEND) {
d(printf ("unsupported provider: '%s'\n", uri));
return;
}
@@ -915,7 +921,7 @@ mail_send (void)
return;
data = setup_send_data ();
- info = g_hash_table_lookup (data->active, transport->url);
+ info = g_hash_table_lookup (data->active, SEND_URI_KEY);
if (info != NULL) {
d(printf("send of %s still in progress\n", transport->url));
return;
@@ -943,7 +949,7 @@ mail_send (void)
d(printf("Adding new info %p\n", info));
- g_hash_table_insert (data->active, info->uri, info);
+ g_hash_table_insert (data->active, SEND_URI_KEY, info);
/* todo, store the folder in info? */
mail_send_queue (outbox_folder, info->uri,