2005-01-27 [colin] 1.0.0cvs16
[claws.git] / src / compose.c
index 48727c112d9476c3805b8f87b18ca9f695e7f779..78c747894efe8ed61b6ff8dc5846f36f86078164 100644 (file)
@@ -1390,7 +1390,7 @@ Compose *compose_redirect(PrefsAccount *account, MsgInfo *msginfo)
        ifactory = gtk_item_factory_from_widget(compose->popupmenu);
        menu_set_sensitive(ifactory, "/Add...", FALSE);
        menu_set_sensitive(ifactory, "/Remove", FALSE);
-       menu_set_sensitive(ifactory, "/Property...", FALSE);
+       menu_set_sensitive(ifactory, "/Properties...", FALSE);
 
        ifactory = gtk_item_factory_from_widget(compose->menubar);
        menu_set_sensitive(ifactory, "/Message/Save", FALSE);
@@ -2761,13 +2761,21 @@ static void compose_wrap_line_all_full(Compose *compose, gboolean autowrap)
                                }
 
                                GET_CHAR(cur_pos, cb, clen);
-
-                               /* insert space if it's alphanumeric */
-                               if ((cur_pos != line_pos) &&
-                                   ((clen > 1) || isalnum((guchar)cb[0]))) {
-                                       gtk_stext_insert(text, NULL, NULL,
-                                                       NULL, " ", 1);
-                                       tlen++;
+                               /* insert space between the next line */
+                               if (cur_pos > 0) {
+                                       gint clen_prev;
+                                       gchar cb_prev[MB_LEN_MAX];
+
+                                       GET_CHAR(cur_pos - 1, cb_prev,
+                                                clen_prev);
+                                       if ((clen_prev != clen && clen > 1) ||
+                                           (clen == 1 &&
+                                            !isspace((guchar)cb[0]))) {
+                                               gtk_stext_insert
+                                                       (text, NULL, NULL,
+                                                        NULL, " ", 1);
+                                               tlen++;
+                                       }
                                }
 
                                /* and start over with current line */
@@ -3457,6 +3465,10 @@ static gint compose_write_to_file(Compose *compose, FILE *fp, gint action)
        mimetext->subtype = g_strdup("plain");
        g_hash_table_insert(mimetext->typeparameters, g_strdup("charset"),
                            g_strdup(out_codeset));
+       /* protect trailing spaces when signing message */
+       if (action == COMPOSE_WRITE_FOR_SEND && compose->use_signing && 
+           privacy_system_can_sign(compose->privacy_system))
+               encoding = ENC_QUOTED_PRINTABLE;
        if (encoding != ENC_UNKNOWN)
                procmime_encode_content(mimetext, encoding);
 
@@ -6111,7 +6123,7 @@ static void compose_draft_cb(gpointer data, guint action, GtkWidget *widget)
        }
        fprintf(fp, "X-Sylpheed-Sign:%d\n", compose->use_signing);
        fprintf(fp, "X-Sylpheed-Encrypt:%d\n", compose->use_encryption);
-       fprintf(fp, "X-Sylpheed-Gnupg-Mode:%s\n", compose->privacy_system);
+       fprintf(fp, "X-Sylpheed-Privacy-System:%s\n", compose->privacy_system);
        fprintf(fp, "\n");
 
        if (compose_write_to_file(compose, fp, COMPOSE_WRITE_FOR_STORE) < 0) {
@@ -6911,3 +6923,16 @@ static void compose_add_field_list( Compose *compose, GList *listAddress ) {
  * End of Source.
  */
 
+void compose_reply_from_messageview(MessageView *msgview, GSList *msginfo_list, 
+                                   guint action)
+{
+       gchar *body;
+
+       g_return_if_fail(msgview != NULL);
+
+       g_return_if_fail(msginfo_list != NULL);
+
+       body = messageview_get_selection(msgview);
+       compose_reply_mode((ComposeMode)action, msginfo_list, body);
+       g_free(body);
+}