* AUTHORS
authorAlfons Hoogervorst <alfons@proteus.demon.nl>
Sat, 14 Jun 2003 13:36:28 +0000 (13:36 +0000)
committerAlfons Hoogervorst <alfons@proteus.demon.nl>
Sat, 14 Jun 2003 13:36:28 +0000 (13:36 +0000)
add Martin Wicke
* src/action.c
* src/messageview.[ch]
* src/summaryview.c
apply patch #754162 "Quoting messages filtered by actions" submitted
by Martin Wicke, which allows quoting message body changed by an
action (Thanks!).

AUTHORS
ChangeLog.claws
configure.ac
src/action.c
src/messageview.c
src/messageview.h
src/summaryview.c

diff --git a/AUTHORS b/AUTHORS
index c700407..d9dab7b 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -177,3 +177,4 @@ contributors (beside the above; based on Changelog)
        Radek Vybiral
        Tsu-Fan Cheng
        Martin Zwickel
+       Martin Wicke
index 1a83ccf..689fba4 100644 (file)
@@ -1,3 +1,14 @@
+2003-06-14 [alfons]    0.9.0claws37
+
+       * AUTHORS
+               add Martin Wicke
+       * src/action.c
+       * src/messageview.[ch]
+       * src/summaryview.c
+               apply patch #754162 "Quoting messages filtered by actions" submitted
+               by Martin Wicke, which allows quoting message body changed by an
+               action (Thanks!).
+
 2003-06-13 [alfons]    0.9.0claws36
 
        * src/utils.c
index 34dbba1..1b3f9d0 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws36
+EXTRA_VERSION=claws37
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index e18dffa..34be9b9 100644 (file)
@@ -507,7 +507,8 @@ static void message_actions_execute(MessageView *msgview, guint action_nb,
        GtkWidget *text = NULL;
        GdkFont *msgfont = NULL;
        guint body_pos = 0;
-
+       ActionType action_type;
+       
        g_return_if_fail(action_nb < g_slist_length(prefs_common.actions_list));
 
        buf = (gchar *)g_slist_nth_data(prefs_common.actions_list, action_nb);
@@ -526,6 +527,11 @@ static void message_actions_execute(MessageView *msgview, guint action_nb,
        }
        partinfo = messageview_get_selected_mime_part(msgview);
 
+       /* this command will alter the message text */
+       action_type = action_get_type(action);
+       if (action_type & (ACTION_PIPE_OUT | ACTION_INSERT))
+               msgview->filtered = TRUE;
+
        execute_actions(action, msg_list, text, msgfont, body_pos, partinfo);
 }
 
index 87ece4f..a1dfcc1 100644 (file)
@@ -768,6 +768,7 @@ void messageview_clear(MessageView *messageview)
        procmsg_msginfo_free(messageview->msginfo);
        messageview->msginfo = NULL;
        messageview_change_view_type(messageview, MVIEW_TEXT);
+       messageview->filtered = FALSE;
        headerview_clear(messageview->headerview);
        textview_clear(messageview->textview);
        noticeview_hide(messageview->noticeview);
@@ -1117,10 +1118,9 @@ static PrefsAccount *select_account_from_list(GList *ac_list)
        return account_find_from_id(account_id);
 }
 
-
 /* 
- * \brief return selected messageview text used by composing 
- *       to reply to selected text only
+ * \brief return selected messageview text, when nothing is 
+ *       selected and message was filtered, return complete text
  *
  * \param  pointer to Messageview 
  *
@@ -1129,20 +1129,34 @@ static PrefsAccount *select_account_from_list(GList *ac_list)
 gchar *messageview_get_selection(MessageView *msgview)
 {
        gchar *text = NULL;
+       GtkEditable *edit = NULL;
+       gint body_pos = 0;
        
        g_return_val_if_fail(msgview != NULL, NULL);
 
-       text = gtkut_editable_get_selection
-               (GTK_EDITABLE(msgview->textview->text));
-       
-       if (!text && msgview->type == MVIEW_MIME
-           && msgview->mimeview->type == MIMEVIEW_TEXT
-           && msgview->mimeview->textview
-           && !msgview->mimeview->textview->default_text) {
-               text = gtkut_editable_get_selection 
-                       (GTK_EDITABLE(msgview->mimeview->textview->text));   
+       if (msgview->type == MVIEW_TEXT) {
+               edit = GTK_EDITABLE(msgview->textview->text);
+               body_pos = msgview->textview->body_pos;
        }
+       else if (msgview->type == MVIEW_MIME
+                && msgview->mimeview->type == MIMEVIEW_TEXT
+                && msgview->mimeview->textview
+                && !msgview->mimeview->textview->default_text) {
+               edit = GTK_EDITABLE(msgview->mimeview->textview->text);
+               body_pos = msgview->mimeview->textview->body_pos;
+       }
+
+       g_return_val_if_fail(edit != NULL, NULL);
 
+       printf("filtered: %d\n", msgview->filtered);
+       
+       if (edit->has_selection)
+               text = gtkut_editable_get_selection(edit);
+       else if (msgview->filtered) 
+               text = gtk_editable_get_chars (edit, body_pos, -1);
+       else
+               text = NULL;
+       
        return text;
 }
 
index f640ccc..9308b91 100644 (file)
@@ -66,6 +66,9 @@ struct _MessageView
 
        gboolean visible;
 
+       /* this message was filtered by an action */
+       gboolean filtered;
+  
        /* From messageview_show */
        gboolean all_headers;
 };
index 6478863..ac2524f 100644 (file)
@@ -2437,7 +2437,12 @@ static void summary_display_msg_full(SummaryView *summaryview,
        MsgFlags flags;
        gchar *filename;
 
-       if (!new_window && summaryview->displayed == row) return;
+       if (!new_window)
+               if (summaryview->displayed == row)
+                       return;
+               else
+                       summaryview->messageview->filtered = FALSE;
+       
        g_return_if_fail(row != NULL);
 
        if (summary_is_locked(summaryview)) return;