aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-callbacks.c
diff options
context:
space:
mode:
authorJon Trowbridge <trow@ximian.com>2001-08-23 10:58:14 +0800
committerJon Trowbridge <trow@src.gnome.org>2001-08-23 10:58:14 +0800
commit6fba7d7077b165410cb9362597f074556093561c (patch)
tree18f6abed525857e76f75d6bebfb239e9e5860f27 /mail/mail-callbacks.c
parente27c0f7d1a89c33e7c81de58984c7fb043f102f6 (diff)
downloadgsoc2013-evolution-6fba7d7077b165410cb9362597f074556093561c.tar.gz
gsoc2013-evolution-6fba7d7077b165410cb9362597f074556093561c.tar.zst
gsoc2013-evolution-6fba7d7077b165410cb9362597f074556093561c.zip
In the GUI, the toggle is labelled "hide addresses", not "show addresses"
2001-08-22 Jon Trowbridge <trow@ximian.com> * 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 <trow@ximian.com> * 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 <trow@ximian.com> * 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
Diffstat (limited to 'mail/mail-callbacks.c')
-rw-r--r--mail/mail-callbacks.c44
1 files changed, 39 insertions, 5 deletions
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;
}