diff -cr pan-0.12.91.orig/pan/identities/identity.c pan-0.12.91/pan/identities/identity.c *** pan-0.12.91.orig/pan/identities/identity.c 2002-08-03 14:32:16.000000000 +0100 --- pan-0.12.91/pan/identities/identity.c 2002-08-03 15:52:05.000000000 +0100 *************** *** 48,53 **** --- 48,54 ---- id->attribution = g_strdup (_("On %d, %n wrote:")); /* default attribution */ id->msg_id_fqdn = NULL; id->custom_headers = g_ptr_array_new (); + id->disable_fido = NULL; } void *************** *** 84,89 **** --- 85,92 ---- g_ptr_array_free (id->custom_headers, TRUE); } + g_free (id->disable_fido); + pan_object_destructor (obj); } *************** *** 144,149 **** --- 147,154 ---- } } + replace_gstr (&new_id->disable_fido, g_strdup (id->disable_fido)); + return new_id; } *************** *** 221,226 **** --- 226,239 ---- replace_gstr (&id->msg_id_fqdn, g_strdup (msg_id_fqdn)); } + void + identity_set_disable_fido (Identity * id, const char * disable_fido) + { + g_return_if_fail (id!=NULL); + + replace_gstr (&id->disable_fido, g_strdup (disable_fido)); + } + gboolean identity_is_valid (const Identity * id) { diff -cr pan-0.12.91.orig/pan/identities/identity-edit-ui.c pan-0.12.91/pan/identities/identity-edit-ui.c *** pan-0.12.91.orig/pan/identities/identity-edit-ui.c 2002-08-03 14:32:16.000000000 +0100 --- pan-0.12.91/pan/identities/identity-edit-ui.c 2002-08-03 15:52:05.000000000 +0100 *************** *** 68,73 **** --- 68,75 ---- GtkWidget * custom_headers_text; + GtkWidget * disable_fido_tb; + gchar * identity_name; } IdentityEditDialog; *************** *** 412,420 **** GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); frame = gtk_frame_new (_("Custom Headers")); gtk_container_set_border_width (GTK_CONTAINER(frame), GUI_PAD); ! gtk_container_add (GTK_CONTAINER(frame), scroll); return frame; } --- 414,431 ---- GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + w = gtk_check_button_new_with_label (_("Disable X-Comment-To header")); + d->disable_fido_tb = w; + + w = gtk_vbox_new (FALSE, 0); + gtk_container_set_border_width (GTK_CONTAINER(w), GUI_PAD); + gtk_box_pack_start (GTK_BOX(w), scroll, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX(w), d->disable_fido_tb, FALSE, TRUE, 0); + frame = gtk_frame_new (_("Custom Headers")); gtk_container_set_border_width (GTK_CONTAINER(frame), GUI_PAD); ! ! gtk_container_add (GTK_CONTAINER(frame), w); return frame; } *************** *** 422,427 **** --- 433,441 ---- static void populate_headers_tab (IdentityEditDialog *d, const Identity *id) { + GtkWidget * w; + gboolean df = FALSE; + g_return_if_fail (d!=NULL); if (id!=NULL && id->custom_headers) *************** *** 444,449 **** --- 458,468 ---- g_string_free (headers, TRUE); } + + w = d->disable_fido_tb; + if (id!=NULL) + df = (!pan_strcmp(id->disable_fido, "y")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), df); } *************** *** 503,508 **** --- 522,532 ---- } } g_strfreev (lines); + + if (GTK_TOGGLE_BUTTON (d->disable_fido_tb)->active) + replace_gstr (&id->disable_fido, g_strdup("y")); + else + replace_gstr (&id->disable_fido, g_strdup("n")); } /***** diff -cr pan-0.12.91.orig/pan/identities/identity.h pan-0.12.91/pan/identities/identity.h *** pan-0.12.91.orig/pan/identities/identity.h 2002-08-03 14:32:16.000000000 +0100 --- pan-0.12.91/pan/identities/identity.h 2002-08-03 15:52:05.000000000 +0100 *************** *** 54,59 **** --- 54,60 ---- gchar * attribution; gchar * msg_id_fqdn; GPtrArray * custom_headers; + gchar * disable_fido; }; /** *************** *** 72,77 **** --- 73,79 ---- void identity_set_signature (Identity * id, const gchar * sig); void identity_set_attribution (Identity * id, const gchar * attrib); void identity_set_msg_id_fqdn (Identity * id, const gchar * msg_id_fqdn); + void identity_set_disable_fido (Identity * id, const char * disable_fido) ; gboolean identity_is_valid (const Identity *); diff -cr pan-0.12.91.orig/pan/identities/identity-xml.c pan-0.12.91/pan/identities/identity-xml.c *** pan-0.12.91.orig/pan/identities/identity-xml.c 2002-08-03 14:32:16.000000000 +0100 --- pan-0.12.91/pan/identities/identity-xml.c 2002-08-03 15:52:05.000000000 +0100 *************** *** 145,150 **** --- 145,158 ---- g_string_append (gstr, ""); } + if (is_nonempty_string(id->disable_fido)) + { + newline_depth (gstr, depth); + g_string_append (gstr, ""); + pan_g_string_append_escaped (gstr, id->disable_fido); + g_string_append (gstr, ""); + } + /* custom headers */ if (id->custom_headers->len > 0) { *************** *** 377,382 **** --- 385,393 ---- if (!pan_strcmp (name, "msg_id_fqdn")) func = identity_set_msg_id_fqdn; else + if (!pan_strcmp(name, "disable_fido")) + func = identity_set_disable_fido; + else func = NULL; if (func != NULL && child->xmlChildrenNode != NULL) diff -cr pan-0.12.91.orig/pan/message-window.c pan-0.12.91/pan/message-window.c *** pan-0.12.91.orig/pan/message-window.c 2002-08-03 14:32:16.000000000 +0100 --- pan-0.12.91/pan/message-window.c 2002-08-03 15:52:05.000000000 +0100 *************** *** 1815,1860 **** const char * cp; GMimeMessage * m; char * default_id_name; g_return_if_fail (mw != NULL); m = mw->message; /** - *** Populate the extra headers - **/ - - { - GString * gstr = g_string_new (NULL); - - /* start with "X-Comment-To:" header for Fido users. */ - if (1) { - const char * author = mw->message ? g_mime_message_get_header (mw->message, HEADER_FROM) : "ALL"; - g_string_sprintfa (gstr, "X-Comment-To: %s\n", author); - } - - if (mw->message!=NULL && is_original (mw->type)) - g_mime_header_foreach (GMIME_OBJECT(mw->message)->headers, extra_header_func, gstr); - - /* add the headers */ - if (1) { - GtkTextView * view = GTK_TEXT_VIEW(mw->custom_headers_text); - GtkTextBuffer * buffer = gtk_text_view_get_buffer (view); - GtkTextIter start; - GtkTextIter end; - char * freeme; - const char * text = pan_utf8ize (gstr->str, gstr->len, &freeme); - gtk_text_buffer_get_bounds (buffer, &start, &end); - gtk_text_buffer_delete (buffer, &start, &end); - gtk_text_buffer_insert (buffer, &start, text, g_utf8_strlen(text,-1)); - g_free (freeme); - } - - /* cleanup */ - g_string_free (gstr, TRUE); - } - - /** *** Subject **/ --- 1815,1827 ---- const char * cp; GMimeMessage * m; char * default_id_name; + Identity * id; g_return_if_fail (mw != NULL); m = mw->message; /** *** Subject **/ *************** *** 2045,2056 **** /* populate the identity menu, setting a default id */ default_id_name = determine_default_identity (mw); populate_identity_menu (mw, default_id_name); g_free (default_id_name); if (is_nonempty_string (mw->identity_name)) { - Identity * id = identity_manager_get_identity (mw->identity_name); - if (id) { apply_identity (mw, id); --- 2012,2057 ---- /* populate the identity menu, setting a default id */ default_id_name = determine_default_identity (mw); populate_identity_menu (mw, default_id_name); + id = identity_manager_get_identity (mw->identity_name); + + /** + *** Populate the extra headers + **/ + + { + GString * gstr = g_string_new (NULL); + + /* start with "X-Comment-To:" header for Fido users. */ + if (pan_strcmp(id->disable_fido, "y")) { + const char * author = mw->message ? g_mime_message_get_header (mw->message, HEADER_FROM) : "ALL"; + g_string_sprintfa (gstr, "X-Comment-To: %s\n", author); + } + + if (mw->message!=NULL && is_original (mw->type)) + g_mime_header_foreach (GMIME_OBJECT(mw->message)->headers, extra_header_func, gstr); + + /* add the headers */ + if (1) { + GtkTextView * view = GTK_TEXT_VIEW(mw->custom_headers_text); + GtkTextBuffer * buffer = gtk_text_view_get_buffer (view); + GtkTextIter start; + GtkTextIter end; + char * freeme; + const char * text = pan_utf8ize (gstr->str, gstr->len, &freeme); + gtk_text_buffer_get_bounds (buffer, &start, &end); + gtk_text_buffer_delete (buffer, &start, &end); + gtk_text_buffer_insert (buffer, &start, text, g_utf8_strlen(text,-1)); + g_free (freeme); + } + + /* cleanup */ + g_string_free (gstr, TRUE); + } + g_free (default_id_name); if (is_nonempty_string (mw->identity_name)) { if (id) { apply_identity (mw, id);