#endif
static void compose_toggle_return_receipt_cb(gpointer data, guint action,
GtkWidget *widget);
-static void compose_toggle_new_thread_cb(gpointer data, guint action,
+static void compose_toggle_remove_refs_cb(gpointer data, guint action,
GtkWidget *widget);
static void compose_set_priority_cb (gpointer data,
guint action,
{N_("/_Message/Priority/_Lowest"), NULL, compose_set_priority_cb, PRIORITY_LOWEST, "/Message/Priority/Highest"},
{N_("/_Message/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_Message/_Request Return Receipt"), NULL, compose_toggle_return_receipt_cb, 0, "<ToggleItem>"},
- {N_("/_Message/_Remove references"), NULL, compose_toggle_new_thread_cb, 0, "<ToggleItem>"},
+ {N_("/_Message/Remo_ve references"), NULL, compose_toggle_remove_refs_cb, 0, "<ToggleItem>"},
{N_("/_Tools"), NULL, NULL, 0, "<Branch>"},
{N_("/_Tools/Show _ruler"), NULL, compose_toggle_ruler_cb, 0, "<ToggleItem>"},
{N_("/_Tools/_Address book"), "<shift><control>A", compose_address_cb , 0, NULL},
ifactory = gtk_item_factory_from_widget(compose->menubar);
menu_set_toggle(ifactory, "/Message/Remove references", FALSE);
+ menu_set_sensitive(ifactory, "/Message/Remove references", TRUE);
compose->replyinfo = procmsg_msginfo_get_full_info(msginfo);
if (!compose->replyinfo)
compose->fwdinfo = procmsg_msginfo_copy(msginfo);
if (msginfo->subject && *msginfo->subject) {
- gtk_entry_set_text(GTK_ENTRY(compose->subject_entry), "Fw: ");
- gtk_entry_append_text(GTK_ENTRY(compose->subject_entry),
- msginfo->subject);
+ gchar *buf, *buf2, *p;
+
+ buf = p = g_strdup(msginfo->subject);
+ p += subject_get_prefix_length(p);
+ memmove(buf, p, strlen(p) + 1);
+
+ buf2 = g_strdup_printf("Fw: %s", buf);
+ gtk_entry_set_text(GTK_ENTRY(compose->subject_entry), buf2);
+
+ g_free(buf);
+ g_free(buf2);
}
text = GTK_STEXT(compose->text);
g_return_val_if_fail(msginfo != NULL, NULL);
if (!account)
- account = cur_account;
+ account = account_get_reply_account(msginfo,
+ prefs_common.reply_account_autosel);
g_return_val_if_fail(account != NULL, NULL);
compose = compose_create(account, COMPOSE_REDIRECT);
gchar *buf, *buf2, *p;
buf = p = g_strdup(msginfo->subject);
- p += subject_get_reply_prefix_length(p);
+ p += subject_get_prefix_length(p);
memmove(buf, p, strlen(p) + 1);
buf2 = g_strdup_printf("Re: %s", buf);
if (content_type) {
ainfo->content_type = g_strdup(content_type);
if (!strcasecmp(content_type, "message/rfc822")) {
+ MsgInfo *msginfo;
+ MsgFlags flags = {0, 0};
+ gchar *name;
+
if (procmime_get_encoding_for_file(file) == ENC_7BIT)
ainfo->encoding = ENC_7BIT;
else
ainfo->encoding = ENC_8BIT;
- ainfo->name = g_strdup_printf
- (_("Message: %s"),
- g_basename(filename ? filename : file));
+
+ msginfo = procheader_parse_file(file, flags, FALSE, FALSE);
+ if (msginfo && msginfo->subject)
+ name = msginfo->subject;
+ else
+ name = g_basename(filename ? filename : file);
+
+ ainfo->name = g_strdup_printf(_("Message: %s"), name);
+
+ procmsg_msginfo_free(msginfo);
} else {
if (!g_strncasecmp(content_type, "text", 4))
ainfo->encoding =
activate_gnupg_mode(compose, account);
#endif /* USE_GPGME */
- if (!init)
+ if (!init && compose->mode != COMPOSE_REDIRECT)
compose_insert_sig(compose, TRUE);
}
fprintf(fp, "\n--%s\n", compose->boundary);
fprintf(fp, "Content-Type: text/plain; charset=%s\n",
out_codeset);
+#if USE_GPGME
+ if (compose->use_signing && !compose->gnupg_mode)
+ fprintf(fp, "Content-Disposition: inline\n");
+#endif
fprintf(fp, "Content-Transfer-Encoding: %s\n",
procmime_get_encoding_str(encoding));
fputc('\n', fp);
ifactory = gtk_item_factory_from_widget(menubar);
menu_set_sensitive(ifactory, "/Edit/Undo", FALSE);
menu_set_sensitive(ifactory, "/Edit/Redo", FALSE);
+ menu_set_sensitive(ifactory, "/Message/Remove references", FALSE);
tmpl_menu = gtk_item_factory_get_item(ifactory, "/Tools/Template");
#if 0 /* NEW COMPOSE GUI */
toolbar_comp_set_sensitive(compose, allow);
menu_set_sensitive(ifactory, "/File", allow);
menu_set_sensitive(ifactory, "/Edit", allow);
+#if USE_ASPELL
menu_set_sensitive(ifactory, "/Spelling", allow);
+#endif
menu_set_sensitive(ifactory, "/Message", allow);
menu_set_sensitive(ifactory, "/Tools", allow);
menu_set_sensitive(ifactory, "/Help", allow);
compose->return_receipt = FALSE;
}
-static void compose_toggle_new_thread_cb(gpointer data, guint action,
+static void compose_toggle_remove_refs_cb(gpointer data, guint action,
GtkWidget *widget)
{
Compose *compose = (Compose *)data;