diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-06-30 04:20:21 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-06-30 04:20:21 +0800 |
commit | 86d9e4453e88e3fa5f72c2c06da81aef272ed7aa (patch) | |
tree | 7216e7cb2f7e6df7b05a76baa875f4e2e12ad13d | |
parent | c9562d914e2065b0813435a187f006fe3e627e94 (diff) | |
download | gsoc2013-evolution-86d9e4453e88e3fa5f72c2c06da81aef272ed7aa.tar.gz 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
-rw-r--r-- | mail/ChangeLog | 14 | ||||
-rw-r--r-- | mail/mail-callbacks.c | 49 | ||||
-rw-r--r-- | mail/mail-config.c | 27 | ||||
-rw-r--r-- | mail/mail-config.h | 3 |
4 files changed, 91 insertions, 2 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index e357ec489b..10cc88d228 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,17 @@ +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. + 2001-06-29 Dan Winship <danw@ximian.com> * mail-account-gui.c (build_auth_menu): Take two authtypes lists, 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; diff --git a/mail/mail-config.c b/mail/mail-config.c index 6d8b10ead9..c1b6f884f4 100644 --- a/mail/mail-config.c +++ b/mail/mail-config.c @@ -59,6 +59,7 @@ typedef struct { gboolean citation_highlight; guint32 citation_color; gboolean prompt_empty_subject; + gboolean prompt_only_bcc; gint seen_timeout; GSList *accounts; @@ -505,6 +506,14 @@ config_read (void) config->prompt_empty_subject = TRUE; g_free (str); + /* Only Bcc */ + str = g_strdup_printf ("=%s/config/Mail=/Prompts/only_bcc", + evolution_dir); + config->prompt_only_bcc = gnome_config_get_bool_with_default (str, &def); + if (def) + config->prompt_only_bcc = TRUE; + g_free (str); + /* PGP/GPG */ str = g_strdup_printf ("=%s/config/Mail=/PGP/path", evolution_dir); @@ -759,6 +768,12 @@ mail_config_write_on_exit (void) gnome_config_set_bool (str, config->prompt_empty_subject); g_free (str); + /* Only Bcc */ + str = g_strdup_printf ("=%s/config/Mail=/Prompts/only_bcc", + evolution_dir); + gnome_config_set_bool (str, config->prompt_only_bcc); + g_free (str); + /* PGP/GPG */ str = g_strdup_printf ("=%s/config/Mail=/PGP/path", evolution_dir); @@ -1021,6 +1036,18 @@ mail_config_set_prompt_empty_subject (gboolean value) config->prompt_empty_subject = value; } +gboolean +mail_config_get_prompt_only_bcc (void) +{ + return config->prompt_only_bcc; +} + +void +mail_config_set_prompt_only_bcc (gboolean value) +{ + config->prompt_only_bcc = value; +} + struct { char *bin; diff --git a/mail/mail-config.h b/mail/mail-config.h index 66fca278db..d65ced4f7d 100644 --- a/mail/mail-config.h +++ b/mail/mail-config.h @@ -133,6 +133,9 @@ void mail_config_set_mark_as_seen_timeout (gint timeout); gboolean mail_config_get_prompt_empty_subject (void); void mail_config_set_prompt_empty_subject (gboolean value); +gboolean mail_config_get_prompt_only_bcc (void); +void mail_config_set_prompt_only_bcc (gboolean value); + CamelPgpType mail_config_get_pgp_type (void); void mail_config_set_pgp_type (CamelPgpType pgp_type); |