diff options
author | Peter Williams <peterw@src.gnome.org> | 2000-06-24 03:07:01 +0800 |
---|---|---|
committer | Peter Williams <peterw@src.gnome.org> | 2000-06-24 03:07:01 +0800 |
commit | aa68bd85f17d3fecdcbcaa77f3957ba7bb6d559a (patch) | |
tree | a640a7d165f6a6b2e5572252778d771bd01e44c2 /mail/session.c | |
parent | cfe31b1d5ca4bd0402e9147b5fd5182fbe7be609 (diff) | |
download | gsoc2013-evolution-aa68bd85f17d3fecdcbcaa77f3957ba7bb6d559a.tar gsoc2013-evolution-aa68bd85f17d3fecdcbcaa77f3957ba7bb6d559a.tar.gz gsoc2013-evolution-aa68bd85f17d3fecdcbcaa77f3957ba7bb6d559a.tar.bz2 gsoc2013-evolution-aa68bd85f17d3fecdcbcaa77f3957ba7bb6d559a.tar.lz gsoc2013-evolution-aa68bd85f17d3fecdcbcaa77f3957ba7bb6d559a.tar.xz gsoc2013-evolution-aa68bd85f17d3fecdcbcaa77f3957ba7bb6d559a.tar.zst gsoc2013-evolution-aa68bd85f17d3fecdcbcaa77f3957ba7bb6d559a.zip |
Land most of the stuff to move fetch_mail, send_mail, expunge_folder, init_imap, and init_news to async operation.
svn path=/trunk/; revision=3711
Diffstat (limited to 'mail/session.c')
-rw-r--r-- | mail/session.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/mail/session.c b/mail/session.c index 259a087377..09b1250cf1 100644 --- a/mail/session.c +++ b/mail/session.c @@ -9,11 +9,20 @@ #include <config.h> #include <gnome.h> #include "mail.h" +#include "mail-threads.h" #include "e-util/e-setup.h" CamelSession *session; GHashTable *passwords; +/* FIXME: Will this ever be called in a non-async + * manner? Better hope not, cause if that happens + * we deadlock.... + */ + +#define ASYNC_AUTH_CALLBACK + +#ifndef ASYNC_AUTH_CALLBACK static void request_callback (gchar *string, gpointer data) { @@ -24,13 +33,17 @@ request_callback (gchar *string, gpointer data) else *ans = NULL; } +#endif static char * evolution_auth_callback (CamelAuthCallbackMode mode, char *data, gboolean secret, CamelService *service, char *item, CamelException *ex) { +#ifndef ASYNC_AUTH_CALLBACK GtkWidget *dialog; +#endif + char *key, *ans; if (!passwords) @@ -66,6 +79,7 @@ evolution_auth_callback (CamelAuthCallbackMode mode, char *data, return g_strdup (ans); } +#ifndef ASYNC_AUTH_CALLBACK /* XXX parent window? */ dialog = gnome_request_dialog (secret, data, NULL, 0, request_callback, &ans, NULL); @@ -82,6 +96,13 @@ evolution_auth_callback (CamelAuthCallbackMode mode, char *data, g_free (key); return NULL; } +#else + if( mail_op_get_password( data, secret, &ans ) == FALSE ) { + camel_exception_set( ex, CAMEL_EXCEPTION_USER_CANCEL, ans ); + g_free( key ); + return NULL; + } +#endif g_hash_table_insert (passwords, key, g_strdup (ans)); return ans; |