2007-06-04 [colin] 2.9.2cvs39
[claws.git] / src / compose.c
index 780fb784759b6e5641a6d21d9fe1047cb8d65438..1a11e10f017f6db2480a775f0171aa2a5ea3e776 100644 (file)
@@ -1398,7 +1398,6 @@ static Compose *compose_generic_reply(MsgInfo *msginfo,
        GtkItemFactory *ifactory;
        Compose *compose;
        PrefsAccount *account = NULL;
-       PrefsAccount *reply_account;
        GtkTextView *textview;
        GtkTextBuffer *textbuf;
        gboolean quote = FALSE;
@@ -1412,18 +1411,6 @@ static Compose *compose_generic_reply(MsgInfo *msginfo,
 
        g_return_val_if_fail(account != NULL, NULL);
 
-       if (to_sender && account->protocol == A_NNTP &&
-           !followup_and_reply_to) {
-               reply_account =
-                       account_find_from_address(account->address);
-               if (!reply_account)
-                       reply_account = compose_current_mail_account();
-               if (!reply_account)
-                       return NULL;
-       } else
-               reply_account = account;
-       /* wwp: TODO: why isn't reply_account used below? shouldn't we use reply_account instead of account? */
-
        compose = compose_create(account, COMPOSE_REPLY, FALSE);
 
        compose->updating = TRUE;
@@ -1486,7 +1473,7 @@ static Compose *compose_generic_reply(MsgInfo *msginfo,
 
        if (quote) {
                /* empty quotemark is not allowed */
-               if (qmark && !*qmark);
+               if (qmark == NULL || *qmark == '\0')
                        qmark = "> ";
                compose_quote_fmt(compose, compose->replyinfo,
                                  body_fmt, qmark, body, FALSE, TRUE,
@@ -1582,7 +1569,7 @@ Compose *compose_forward(PrefsAccount *account, MsgInfo *msginfo,
        if (as_attach) {
                gchar *msgfile;
 
-               msgfile = procmsg_get_message_file_path(msginfo);
+               msgfile = procmsg_get_message_file(msginfo);
                if (!is_file_exist(msgfile))
                        g_warning("%s: file not exist\n", msgfile);
                else
@@ -1617,7 +1604,7 @@ Compose *compose_forward(PrefsAccount *account, MsgInfo *msginfo,
                }
 
                /* empty quotemark is not allowed */
-               if (qmark && !*qmark)
+               if (qmark == NULL || *qmark == '\0')
                        qmark = "> ";
 
                compose_quote_fmt(compose, full_msginfo,
@@ -1715,7 +1702,7 @@ static Compose *compose_forward_multiple(PrefsAccount *account, GSList *msginfo_
        
        undo_block(compose->undostruct);
        for (msginfo = msginfo_list; msginfo != NULL; msginfo = msginfo->next) {
-               msgfile = procmsg_get_message_file_path((MsgInfo *)msginfo->data);
+               msgfile = procmsg_get_message_file((MsgInfo *)msginfo->data);
 
                if (!is_file_exist(msgfile))
                        g_warning("%s: file not exist\n", msgfile);
@@ -2087,7 +2074,7 @@ Compose *compose_redirect(PrefsAccount *account, MsgInfo *msginfo,
 
        gtk_widget_grab_focus(compose->header_last->entry);
 
-       filename = procmsg_get_message_file_path(msginfo);
+       filename = procmsg_get_message_file(msginfo);
 
        if (filename == NULL) {
                compose->updating = FALSE;
@@ -3411,9 +3398,10 @@ static void compose_attach_parts(Compose *compose, MsgInfo *msginfo)
 
                        /* if we meet a pgp signature, we don't attach it, but
                         * we force signing. */
-                       if (strcmp(content_type, "application/pgp-signature") &&
+                       if ((strcmp(content_type, "application/pgp-signature") &&
                            strcmp(content_type, "application/pkcs7-signature") &&
-                           strcmp(content_type, "application/x-pkcs7-signature")) {
+                           strcmp(content_type, "application/x-pkcs7-signature"))
+                           || compose->mode == COMPOSE_REDIRECT) {
                                partname = procmime_mimeinfo_get_parameter(child, "filename");
                                if (partname == NULL)
                                        partname = procmime_mimeinfo_get_parameter(child, "name");
@@ -7138,6 +7126,7 @@ static void compose_template_apply(Compose *compose, Template *tmpl,
        buffer = gtk_text_view_get_buffer(text);
 
        if (tmpl->value) {
+               /* FIXME - use per-folder/account quotemark */
                if (prefs_common.quotemark && *prefs_common.quotemark)
                        qmark = prefs_common.quotemark;
                else
@@ -9545,6 +9534,8 @@ static void text_inserted(GtkTextBuffer *buffer, GtkTextIter *iter,
                        len = strlen(text);
 
                new_text = g_strndup(text, len);
+
+               /* FIXME - use per-folder/account quotemark */
                if (prefs_common.quotemark && *prefs_common.quotemark)
                        qmark = prefs_common.quotemark;
                else
@@ -9746,7 +9737,9 @@ static void compose_reply_from_messageview_real(MessageView *msgview, GSList *ms
                                if (procmime_msginfo_is_encrypted(orig_msginfo)) {
                                        originally_enc = TRUE;
                                }
-                       } 
+                               tmp_msginfo->folder = orig_msginfo->folder;
+                               tmp_msginfo->msgnum = orig_msginfo->msgnum; 
+                       }
                }
        }