aboutsummaryrefslogtreecommitdiffstats
path: root/mail/session.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/session.c')
-rw-r--r--mail/session.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/mail/session.c b/mail/session.c
index aa98c20908..185b72f9e8 100644
--- a/mail/session.c
+++ b/mail/session.c
@@ -13,7 +13,9 @@
#include "mail-threads.h"
CamelSession *session;
-GHashTable *passwords;
+
+static GHashTable *passwords;
+static gboolean interaction_enabled;
static void
request_callback (gchar *string, gpointer data)
@@ -41,6 +43,9 @@ mail_session_request_dialog (const char *prompt, gboolean secret, const char *ke
if (ans)
return g_strdup (ans);
+ if (!interaction_enabled)
+ return NULL;
+
if (!async) {
dialog = gnome_request_dialog (secret, prompt, NULL, 0,
request_callback, &ans, NULL);
@@ -260,6 +265,12 @@ mail_session_init (void)
}
}
+void
+mail_session_enable_interaction (gboolean enable)
+{
+ interaction_enabled = enable;
+}
+
static gboolean
free_entry (gpointer key, gpointer value, gpointer user_data)
{