fix crash when using Forward in Filtering when external editor option is set
authorPaul Mangan <paul@claws-mail.org>
Mon, 20 Oct 2003 17:01:17 +0000 (17:01 +0000)
committerPaul Mangan <paul@claws-mail.org>
Mon, 20 Oct 2003 17:01:17 +0000 (17:01 +0000)
ChangeLog.claws
configure.ac
src/compose.c
src/compose.h
src/filtering.c
src/messageview.c

index c6b3ee553c94f106240c67075323da568350f468..24e474f43d763bdcba94313e8c50a5e184e131a8 100644 (file)
@@ -1,3 +1,14 @@
+2003-10-20 [paul]      0.9.6claws36
+
+       * src/compose.[ch]
+         src/filtering.c
+         src/messageview.c
+               fix crash when using Forward in Filtering when
+               external editor option is set
+               
+               Patch submitted by Simon 'corecode' Schubert
+               <corecode@corecode.ath.cx> 
+
 2003-10-20 [paul]      0.9.6claws35
 
        * src/pixmaps/mime_gpg_expired.xpm      ** REMOVED **
index 383fde7ad96efe73ddfb0818a41b3c772348a1c4..27e545319c089984fabd28a06f007806c819474d 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=6
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=35
+EXTRA_VERSION=36
 if test $EXTRA_VERSION -eq 0; then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
 else
index d21118c36c7f34cf7b55863d46c6d9ee008d5ecc..e0d81adabee32e3247a68ab110a994a453b6f3e2 100644 (file)
@@ -882,7 +882,7 @@ void compose_reply_mode(ComposeMode mode, GSList *msginfo_list, gchar *body)
        case COMPOSE_FORWARD_INLINE:
                /* check if we reply to more than one Message */
                if (list_len == 1) {
-                       compose_forward(NULL, msginfo, FALSE, body);
+                       compose_forward(NULL, msginfo, FALSE, body, FALSE);
                        break;
                } 
                /* more messages FALL THROUGH */
@@ -1021,7 +1021,8 @@ if (msginfo->var && *msginfo->var) { \
 }
 
 Compose *compose_forward(PrefsAccount *account, MsgInfo *msginfo,
-                        gboolean as_attach, const gchar *body)
+                        gboolean as_attach, const gchar *body,
+                        gboolean no_extedit)
 {
        Compose *compose;
        GtkSText *text;
@@ -1131,7 +1132,7 @@ Compose *compose_forward(PrefsAccount *account, MsgInfo *msginfo,
 #endif
        gtk_widget_grab_focus(compose->header_last->entry);
 
-       if (prefs_common.auto_exteditor)
+       if (!no_extedit && prefs_common.auto_exteditor)
                compose_exec_ext_editor(compose);
        
        /*save folder*/
index 7a1db31e8bc618f54e6316ade01e595c494d4566..c27bc8a3b7cdd7b55ae83e9ec9b07d3b39ddc26a 100644 (file)
@@ -243,7 +243,8 @@ void compose_reply                  (MsgInfo        *msginfo,
 Compose *compose_forward               (PrefsAccount *account,
                                         MsgInfo        *msginfo,
                                         gboolean        as_attach,
-                                        const gchar    *body);
+                                        const gchar    *body,
+                                        gboolean        no_extedit);
 Compose *compose_forward_multiple      (PrefsAccount   *account, 
                                         GSList         *msginfo_list);
 /* remove end */
index 9c623b721b24f524b36898f417a77b387239c078..853af400576e5003b58eb16f5118ae8dc127218e 100644 (file)
@@ -253,42 +253,20 @@ static gboolean filteringaction_apply(FilteringAction * action, MsgInfo * info)
                return TRUE;
 
        case MATCHACTION_FORWARD:
-               account = account_find_from_id(action->account_id);
-               compose = compose_forward(account, info, FALSE, NULL);
-               if (compose->account->protocol == A_NNTP)
-                       compose_entry_append(compose, action->destination,
-                                            COMPOSE_NEWSGROUPS);
-               else
-                       compose_entry_append(compose, action->destination,
-                                            COMPOSE_TO);
-
-               val = compose_send(compose);
-               if (val == 0) {
-                       gtk_widget_destroy(compose->window);
-                       return TRUE;
-               }
-
-               gtk_widget_destroy(compose->window);
-               return FALSE;
-
        case MATCHACTION_FORWARD_AS_ATTACHMENT:
-
                account = account_find_from_id(action->account_id);
-               compose = compose_forward(account, info, TRUE, NULL);
-               if (compose->account->protocol == A_NNTP)
-                       compose_entry_append(compose, action->destination,
-                                            COMPOSE_NEWSGROUPS);
-               else
-                       compose_entry_append(compose, action->destination,
-                                            COMPOSE_TO);
+               compose = compose_forward(account, info,
+                       action->type == MATCHACTION_FORWARD ? FALSE : TRUE,
+                       NULL, TRUE);
+               compose_entry_append(compose, action->destination,
+                                    compose->account->protocol == A_NNTP
+                                           ? COMPOSE_NEWSGROUPS
+                                           : COMPOSE_TO);
 
                val = compose_send(compose);
-               if (val == 0) {
-                       gtk_widget_destroy(compose->window);
-                       return TRUE;
-               }
                gtk_widget_destroy(compose->window);
-               return FALSE;
+
+               return val == 0 ? TRUE : FALSE;
 
        case MATCHACTION_REDIRECT:
                account = account_find_from_id(action->account_id);
@@ -300,13 +278,9 @@ static gboolean filteringaction_apply(FilteringAction * action, MsgInfo * info)
                                             COMPOSE_TO);
 
                val = compose_send(compose);
-               if (val == 0) {
-                       gtk_widget_destroy(compose->window);
-                       return TRUE;
-               }
-
                gtk_widget_destroy(compose->window);
-               return FALSE;
+               
+               return val == 0 ? TRUE : FALSE;
 
        case MATCHACTION_EXECUTE:
                cmd = matching_build_command(action->unesc_destination, info);
index 591756fdaed24f0f86a568dc043092aee94c9c94..c392a6ed254bc76d84da156cec25845a7216717f 100644 (file)
@@ -1202,7 +1202,7 @@ static void reply_cb(gpointer data, guint action, GtkWidget *widget)
                }
                break;
        case COMPOSE_FORWARD_INLINE:
-               compose_forward(NULL, msginfo, FALSE, text);
+               compose_forward(NULL, msginfo, FALSE, text, FALSE);
                break;
        case COMPOSE_FORWARD_AS_ATTACH:
                compose_forward_multiple(NULL, mlist);