aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-callbacks.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-06-30 04:20:21 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-06-30 04:20:21 +0800
commit86d9e4453e88e3fa5f72c2c06da81aef272ed7aa (patch)
tree7216e7cb2f7e6df7b05a76baa875f4e2e12ad13d /mail/mail-callbacks.c
parentc9562d914e2065b0813435a187f006fe3e627e94 (diff)
downloadgsoc2013-evolution-86d9e4453e88e3fa5f72c2c06da81aef272ed7aa.tar
gsoc2013-evolution-86d9e4453e88e3fa5f72c2c06da81aef272ed7aa.tar.gz
gsoc2013-evolution-86d9e4453e88e3fa5f72c2c06da81aef272ed7aa.tar.bz2
gsoc2013-evolution-86d9e4453e88e3fa5f72c2c06da81aef272ed7aa.tar.lz
gsoc2013-evolution-86d9e4453e88e3fa5f72c2c06da81aef272ed7aa.tar.xz
gsoc2013-evolution-86d9e4453e88e3fa5f72c2c06da81aef272ed7aa.tar.zst
gsoc2013-evolution-86d9e4453e88e3fa5f72c2c06da81aef272ed7aa.zip
Throw up the confirmation dialog. (composer_get_message): If the user only
2001-06-29 Jeffrey Stedfast <fejj@ximian.com> * mail-callbacks.c (ask_confirm_for_only_bcc): Throw up the confirmation dialog. (composer_get_message): If the user only specified Bcc recipients, prompt him/her to make sure we should continue and risk the server adding an Apparently-To header. * mail-config.c (config_read): Read in config option for prompting when only Bcc recipients are specified. (mail_config_write_on_exit): Save the option. (mail_config_get_prompt_only_bcc): New. (mail_config_set_prompt_only_bcc): New. svn path=/trunk/; revision=10606
Diffstat (limited to 'mail/mail-callbacks.c')
-rw-r--r--mail/mail-callbacks.c49
1 files changed, 47 insertions, 2 deletions
diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c
index 209ff16320..0bc2898d27 100644
--- a/mail/mail-callbacks.c
+++ b/mail/mail-callbacks.c
@@ -207,7 +207,7 @@ send_receive_mail (GtkWidget *widget, gpointer user_data)
}
static void
-empty_subject_destroyed (GtkWidget *widget, gpointer data)
+msgbox_destroyed (GtkWidget *widget, gpointer data)
{
gboolean *show_again = data;
GtkWidget *checkbox;
@@ -239,7 +239,7 @@ ask_confirm_for_empty_subject (EMsgComposer *composer)
NULL);
gtk_signal_connect (GTK_OBJECT (mbox), "destroy",
- empty_subject_destroyed, &show_again);
+ msgbox_destroyed, &show_again);
button = gnome_dialog_run_and_close (GNOME_DIALOG (mbox));
@@ -251,6 +251,43 @@ ask_confirm_for_empty_subject (EMsgComposer *composer)
return FALSE;
}
+static gboolean
+ask_confirm_for_only_bcc (EMsgComposer *composer)
+{
+ /* FIXME: EMessageBox should really handle this stuff
+ automagically. What Miguel thinks would be nice is to pass
+ in a message-id which could be used as a key in the config
+ file and the value would be an int. -1 for always show or
+ the button pressed otherwise. This probably means we'd have
+ to write e_messagebox_run () */
+ gboolean show_again = TRUE;
+ GtkWidget *mbox;
+ int button;
+
+ if (!mail_config_get_prompt_only_bcc ())
+ return TRUE;
+
+ mbox = e_message_box_new (_("This message contains only Bcc recipients.\nIt is "
+ "possible that the mail server may reveal the recipients "
+ "by adding an Apparently-To header.\nSend anyway?"),
+ E_MESSAGE_BOX_QUESTION,
+ GNOME_STOCK_BUTTON_YES,
+ GNOME_STOCK_BUTTON_NO,
+ NULL);
+
+ gtk_signal_connect (GTK_OBJECT (mbox), "destroy",
+ msgbox_destroyed, &show_again);
+
+ button = gnome_dialog_run_and_close (GNOME_DIALOG (mbox));
+
+ mail_config_set_prompt_only_bcc (show_again);
+
+ if (button == 0)
+ return TRUE;
+ else
+ return FALSE;
+}
+
static void
free_psd (GtkWidget *composer, gpointer user_data)
{
@@ -312,6 +349,14 @@ composer_get_message (EMsgComposer *composer)
num_addrs += iaddr ? camel_address_length (CAMEL_ADDRESS (iaddr)) : 0;
}
+ if (num_addrs == camel_address_length (CAMEL_ADDRESS (iaddr))) {
+ /* this means that the only recipients are Bcc's */
+ if (!ask_confirm_for_only_bcc (composer)) {
+ camel_object_unref (CAMEL_OBJECT (message));
+ return NULL;
+ }
+ }
+
/* I'm sensing a lack of love, er, I mean recipients. */
if (num_addrs == 0) {
GtkWidget *message_box;