aboutsummaryrefslogtreecommitdiffstats
path: root/mail/session.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-08-12 04:27:12 +0800
committerDan Winship <danw@src.gnome.org>2000-08-12 04:27:12 +0800
commited88f237863dc3dd5aec568196b61008df2e9b8c (patch)
tree10a840b719f981de144c72ff22d19cf0cf64617b /mail/session.c
parent4824927269ed26278e9cddc9d523ad813d0fd626 (diff)
downloadgsoc2013-evolution-ed88f237863dc3dd5aec568196b61008df2e9b8c.tar
gsoc2013-evolution-ed88f237863dc3dd5aec568196b61008df2e9b8c.tar.gz
gsoc2013-evolution-ed88f237863dc3dd5aec568196b61008df2e9b8c.tar.bz2
gsoc2013-evolution-ed88f237863dc3dd5aec568196b61008df2e9b8c.tar.lz
gsoc2013-evolution-ed88f237863dc3dd5aec568196b61008df2e9b8c.tar.xz
gsoc2013-evolution-ed88f237863dc3dd5aec568196b61008df2e9b8c.tar.zst
gsoc2013-evolution-ed88f237863dc3dd5aec568196b61008df2e9b8c.zip
Update this for CamelObject (try_inline_pgp): Deal with decrypting here
* mail-format.c (destroy_part): Update this for CamelObject (try_inline_pgp): Deal with decrypting here rather than trying to pawn the data off to handle_multipart_encrypted, since it most likely won't be correct (won't have the proper MIME headers inside the encrypted part). (handle_multipart_encrypted): Add code from Nathan Thompson-Amato to re-MIME-parse the decrypted data after decrypting. * mail-crypto.c (mail_crypto_openpgp_{de,en}crypt): Get the password here rather than having it passed in. Remove some dead code. * session.c (mail_request_dialog): Allow this to work in either a sync or an async context. svn path=/trunk/; revision=4751
Diffstat (limited to 'mail/session.c')
-rw-r--r--mail/session.c41
1 files changed, 15 insertions, 26 deletions
diff --git a/mail/session.c b/mail/session.c
index 086a7c12fc..9f9072e93f 100644
--- a/mail/session.c
+++ b/mail/session.c
@@ -14,14 +14,6 @@
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)
{
@@ -32,14 +24,12 @@ request_callback (gchar *string, gpointer data)
else
*ans = NULL;
}
-#endif
char *
-mail_request_dialog (const char *prompt, gboolean secret, const char *key)
+mail_request_dialog (const char *prompt, gboolean secret, const char *key,
+ gboolean async)
{
-#ifndef ASYNC_AUTH_CALLBACK
GtkWidget *dialog;
-#endif
char *ans;
@@ -50,19 +40,18 @@ mail_request_dialog (const char *prompt, gboolean secret, const char *key)
if (ans)
return g_strdup (ans);
-#ifndef ASYNC_AUTH_CALLBACK
- /* XXX parent window? */
- dialog = gnome_request_dialog (secret, prompt, NULL, 0,
- request_callback, &ans, NULL);
- if (!dialog)
- return NULL;
- if (gnome_dialog_run_and_close (GNOME_DIALOG (dialog)) == -1 ||
- ans == NULL)
- return NULL;
-#else
- if (!mail_op_get_password ((char *) prompt, secret, &ans))
- return NULL;
-#endif
+ if (!async) {
+ dialog = gnome_request_dialog (secret, prompt, NULL, 0,
+ request_callback, &ans, NULL);
+ if (!dialog)
+ return NULL;
+ if (gnome_dialog_run_and_close (GNOME_DIALOG (dialog)) == -1 ||
+ ans == NULL)
+ return NULL;
+ } else {
+ if (!mail_op_get_password ((char *) prompt, secret, &ans))
+ return NULL;
+ }
g_hash_table_insert (passwords, g_strdup (key), g_strdup (ans));
return ans;
@@ -101,7 +90,7 @@ auth_callback (CamelAuthCallbackMode mode, char *data, gboolean secret,
return NULL;
}
- ans = mail_request_dialog (data, secret, key);
+ ans = mail_request_dialog (data, secret, key, TRUE);
g_free (key);
if (!ans) {