fix bug #516442, two bounce behaviours
authorHoà Viêt Dinh <dinh.viet.hoa@free.fr>
Mon, 25 Mar 2002 22:41:55 +0000 (22:41 +0000)
committerHoà Viêt Dinh <dinh.viet.hoa@free.fr>
Mon, 25 Mar 2002 22:41:55 +0000 (22:41 +0000)
ChangeLog.claws
src/compose.c
src/matcher.c
src/mh.c
src/prefs_common.c
src/prefs_common.h

index 8fbad61..ccc4fdf 100644 (file)
@@ -1,3 +1,15 @@
+2002-03-25 [hoa]       0.7.4claws45
+
+       * src/matcher.c
+       * src/mh.c
+               fix the bug #516442 with folder rescan.
+
+       * src/prefs_common.[ch]
+       * src/compose.c
+               added an option to enable two different behaviours
+               for bounce.
+
+
 2002-03-25 [paul]      0.7.4claws44
 
        * src/mainwindow.c
index 5717a4a..65a2108 100644 (file)
@@ -2838,20 +2838,24 @@ static gint compose_bounce_write_to_file(Compose *compose, const gchar *file)
                if (fputs(buf, fdest) == -1)
                        goto error;
 
-               if (g_strncasecmp(buf, "From:", strlen("From:")) == 0) {
-                       fputs(" (by way of ", fdest);
-                       if (compose->account->name
-                           && *compose->account->name) {
-                               compose_convert_header
-                                       (buf, sizeof(buf),
-                                        compose->account->name,
-                                        strlen("From: "));
-                               fprintf(fdest, "%s <%s>",
-                                       buf, compose->account->address);
-                       } else
-                               fprintf(fdest, "%s",
-                                       compose->account->address);
-                       fputs(")", fdest);
+               if (!prefs_common.bounce_keep_from) {
+                       if (g_strncasecmp(buf, "From:",
+                                         strlen("From:")) == 0) {
+                               fputs(" (by way of ", fdest);
+                               if (compose->account->name
+                                   && *compose->account->name) {
+                                       compose_convert_header
+                                               (buf, sizeof(buf),
+                                                compose->account->name,
+                                                strlen("From: "));
+                                       fprintf(fdest, "%s <%s>",
+                                               buf,
+                                               compose->account->address);
+                               } else
+                                       fprintf(fdest, "%s",
+                                               compose->account->address);
+                               fputs(")", fdest);
+                       }
                }
 
                if (fputs("\n", fdest) == -1)
index f858781..245c659 100644 (file)
@@ -1180,7 +1180,7 @@ void prefs_matcher_read_config(void)
        else {
                /* previous version compatibily */
 
-               printf("reading filtering\n");
+               /* printf("reading filtering\n"); */
                rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
                                     FILTERING_RC, NULL);
                f = fopen(rcpath, "rb");
@@ -1191,7 +1191,7 @@ void prefs_matcher_read_config(void)
                        fclose(matcher_parserin);
                }
                
-               printf("reading scoring\n");
+               /* printf("reading scoring\n"); */
                rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
                                     SCORING_RC, NULL);
                f = fopen(rcpath, "rb");
index 384303b..1ecc2c0 100644 (file)
--- a/src/mh.c
+++ b/src/mh.c
@@ -766,6 +766,8 @@ void mh_scan_tree(Folder *folder)
 
        pptable = folder_persist_prefs_new(folder);
 
+       prefs_scoring_clear();
+       prefs_filtering_clear();
        folder_tree_destroy(folder);
        item = folder_item_new(folder->name, NULL);
        item->folder = folder;
@@ -782,6 +784,8 @@ void mh_scan_tree(Folder *folder)
        mh_scan_tree_recursive(item, pptable);
        
        folder_persist_prefs_free(pptable);
+
+       prefs_matcher_read_config();
 }
 
 #define MAKE_DIR_IF_NOT_EXIST(dir) \
index ca259c3..714fed4 100644 (file)
@@ -125,6 +125,7 @@ static struct Compose {
 
        GtkWidget *checkbtn_quote;
        GtkWidget *checkbtn_forward_as_attachment;
+       GtkWidget *checkbtn_bounce_keep_from;
        GtkWidget *checkbtn_smart_wrapping;
        GtkWidget *checkbtn_block_cursor;
        GtkWidget *checkbtn_reply_with_quote;
@@ -350,6 +351,10 @@ static PrefParam param[] = {
        {"forward_as_attachment", "FALSE", &prefs_common.forward_as_attachment,
         P_BOOL, &compose.checkbtn_forward_as_attachment,
         prefs_set_data_from_toggle, prefs_set_toggle},
+       {"bounce_keep_from", "FALSE",
+        &prefs_common.bounce_keep_from, P_BOOL,
+        &compose.checkbtn_bounce_keep_from,
+        prefs_set_data_from_toggle, prefs_set_toggle},
        {"undo_level", "50", &prefs_common.undolevels, P_INT,
         &compose.spinbtn_undolevel,
         prefs_set_data_from_spinbtn, prefs_set_spinbtn},
@@ -1680,6 +1685,7 @@ static void prefs_compose_create(void)
        GtkWidget *frame_reply;
        GtkWidget *checkbtn_quote;
        GtkWidget *checkbtn_forward_as_attachment;
+       GtkWidget *checkbtn_bounce_keep_from;
        GtkWidget *checkbtn_smart_wrapping;
        GtkWidget *checkbtn_block_cursor;
        GtkWidget *frame_msgwrap;
@@ -1760,6 +1766,9 @@ static void prefs_compose_create(void)
        PACK_CHECK_BUTTON (hbox5, checkbtn_block_cursor,
                          _("Block cursor"));
 
+       PACK_CHECK_BUTTON (vbox2, checkbtn_bounce_keep_from,
+                          _("Keep the original 'From' header when bouncing"));
+
        hbox_undolevel = gtk_hbox_new (FALSE, 8);
        gtk_widget_show (hbox_undolevel);
        gtk_box_pack_start (GTK_BOX (vbox1), hbox_undolevel, FALSE, FALSE, 0);
@@ -1846,6 +1855,8 @@ static void prefs_compose_create(void)
 
        compose.checkbtn_forward_as_attachment =
                checkbtn_forward_as_attachment;
+       compose.checkbtn_bounce_keep_from =
+               checkbtn_bounce_keep_from;
        compose.checkbtn_smart_wrapping = 
                checkbtn_smart_wrapping;
        compose.checkbtn_block_cursor   =
index 40735d3..7259823 100644 (file)
@@ -91,6 +91,7 @@ struct _PrefsCommon
        gchar *fw_quotemark;
        gchar *fw_quotefmt;
        gboolean forward_as_attachment;
+       gboolean bounce_keep_from;
        gboolean smart_wrapping;
        gboolean block_cursor;
 #if USE_PSPELL