From 6fba7d7077b165410cb9362597f074556093561c Mon Sep 17 00:00:00 2001 From: Jon Trowbridge Date: Thu, 23 Aug 2001 02:58:14 +0000 Subject: In the GUI, the toggle is labelled "hide addresses", not "show addresses" 2001-08-22 Jon Trowbridge * gui/contact-list-editor/e-contact-list-editor.c (extract_info): In the GUI, the toggle is labelled "hide addresses", not "show addresses" -- so we have to reverse the boolean value we read in. (fill_in_info): Same bug as before: since the GUI reads "hide", we have to initialize the toggle to '!show_addresses', not 'show_addresses'. * backend/ebook/e-destination.c (e_destination_list_show_addresses): Added. (e_destination_xml_encode): Encode the value of e_destination_list_show_addresses into the XML. (e_destination_xml_decode): Read and store the "show_addresses" flag. 2001-08-22 Jon Trowbridge * e-msg-composer-hdrs.c (set_recipients_from_destv): Added. Try to properly handle contact lists in which the addresses of the list members should be hidden. (e_msg_composer_hdrs_to_message): Changed to extract the destination data from the entries and pass it along to set_recipients_from_destv. 2001-08-22 Jon Trowbridge * mail-callbacks.c (ask_confirm_for_only_bcc): Provide alternative text for this dialog for the case when a message has only Bcc recipients because of a hidden contact list's addresses being moved from To/Cc to Bcc. (composer_get_message): Try to detect when our message has only Bcc recipients because of moving addresses around due to a hidden contact list, and show the dialog with the revised wording in this case. svn path=/trunk/; revision=12414 --- mail/ChangeLog | 26 ++++++++++++++++++++++++-- mail/mail-callbacks.c | 44 +++++++++++++++++++++++++++++++++++++++----- 2 files changed, 63 insertions(+), 7 deletions(-) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index 9c4a45d856..91f46fa083 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,14 @@ +2001-08-22 Jon Trowbridge + + * mail-callbacks.c (ask_confirm_for_only_bcc): Provide alternative + text for this dialog for the case when a message has only Bcc + recipients because of a hidden contact list's addresses being + moved from To/Cc to Bcc. + (composer_get_message): Try to detect when our message has only + Bcc recipients because of moving addresses around due to a hidden + contact list, and show the dialog with the revised wording in this + case. + 2001-08-22 Jeffrey Stedfast * component-factory.c (create_view): Don't blindly make all vtrash @@ -291,8 +302,8 @@ * subscribe-dialog.c (fe_got_children): Sort the nodes here... (fe_sort_folder): ... using this function. - * folder-browser-ui.c (folder_browser_ui_message_loaded): Check for uic - == NULL. I'm not sure how this could happen, but... + * folder-browser-ui.c (folder_browser_ui_message_loaded): Check + for uic == NULL. I'm not sure how this could happen, but... 2001-08-16 Peter Williams @@ -300,6 +311,17 @@ Disable "Search Message" when more or less than exactly one message is selected. + * subscribe-dialog.c (fe_done_subscribing): Instead of hackfully + getting the path, use a CamelURL so that escaping is + handled. Silly me. -- See below -- + (fe_node_to_shell_path): Use node->name and node->full_name to + generate the the shell path of this item. Don't need to escape the + URL, and handle cases when dir_sep != '/' + (fe_done_subscribing): Use fe_node_to_shell_path instead of the + CamelURL. Third time's the charm... * folder-browser-ui.c + (folder_browser_ui_set_selection_state): Disable "Search Message" + when more or less than exactly one message is selected. + * subscribe-dialog.c (fe_done_subscribing): Instead of hackfully getting the path, use a CamelURL so that escaping is handled. Silly me. -- See below -- diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c index 167ac0af55..12ec4d945f 100644 --- a/mail/mail-callbacks.c +++ b/mail/mail-callbacks.c @@ -235,7 +235,7 @@ ask_confirm_for_empty_subject (EMsgComposer *composer) } static gboolean -ask_confirm_for_only_bcc (EMsgComposer *composer) +ask_confirm_for_only_bcc (EMsgComposer *composer, gboolean hidden_list_case) { /* FIXME: EMessageBox should really handle this stuff automagically. What Miguel thinks would be nice is to pass @@ -246,13 +246,31 @@ ask_confirm_for_only_bcc (EMsgComposer *composer) gboolean show_again = TRUE; GtkWidget *mbox; int button; + const gchar *first_text; + gchar *message_text; if (!mail_config_get_prompt_only_bcc ()) return TRUE; + + /* If the user is mailing a hidden contact list, it is possible for + them to create a message with only Bcc recipients without really + realizing it. To try to avoid being totally confusing, I've changed + this dialog to provide slightly different text in that case, to + better explain what the hell is going on. */ + + if (hidden_list_case) { + first_text = _("Since the contact list you are sending to " + "is configured to hide the list's addresses, " + "this message will contain only Bcc recipients."); + } else { + first_text = _("This message contains only Bcc recipients."); + } + + message_text = g_strdup_printf ("%s\n%s", first_text, + _("It is possible that the mail server may reveal the recipients " + "by adding an Apparently-To header.\nSend anyway?")); - 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?"), + mbox = e_message_box_new (message_text, E_MESSAGE_BOX_QUESTION, GNOME_STOCK_BUTTON_YES, GNOME_STOCK_BUTTON_NO, @@ -264,6 +282,8 @@ ask_confirm_for_only_bcc (EMsgComposer *composer) button = gnome_dialog_run_and_close (GNOME_DIALOG (mbox)); mail_config_set_prompt_only_bcc (show_again); + + g_free (message_text); if (button == 0) return TRUE; @@ -350,7 +370,21 @@ composer_get_message (EMsgComposer *composer) if (iaddr && num_addrs == camel_address_length (CAMEL_ADDRESS (iaddr))) { /* this means that the only recipients are Bcc's */ - if (!ask_confirm_for_only_bcc (composer)) { + + /* OK, this is an abusive hack. If someone sends a mail with a + hidden contact list on to to: line and no other recipients, + they will unknowingly create a message with only bcc: recipients. + We try to detect this and pass a flag to ask_confirm_for_only_bcc, + so that it can present the user with a dialog whose text has been + modified to reflect this situation. */ + + const gchar *to_header = camel_medium_get_header (CAMEL_MEDIUM (message), CAMEL_RECIPIENT_TYPE_TO); + gboolean hidden_list_case = FALSE; + + if (to_header && !strcmp (to_header, "Undisclosed-Recipient:;")) + hidden_list_case = TRUE; + + if (!ask_confirm_for_only_bcc (composer, hidden_list_case)) { camel_object_unref (CAMEL_OBJECT (message)); return NULL; } -- cgit v1.2.3