static MsgInfo *compose_msginfo_new_from_compose(Compose *compose);
+#ifdef USE_ASPELL
+static void compose_set_dictionaries_from_folder_prefs(Compose *compose,
+ FolderItem *folder_item);
+#endif
+
static GtkItemFactoryEntry compose_popup_entries[] =
{
{N_("/_Add..."), NULL, compose_attach_cb, 0, NULL},
undo_block(compose->undostruct);
#ifdef USE_ASPELL
- if (item && item->prefs && compose->gtkaspell) {
- if (item->prefs->enable_default_dictionary)
- gtkaspell_change_dict(compose->gtkaspell,
- item->prefs->default_dictionary, FALSE);
- if (item->prefs->enable_default_alt_dictionary)
- gtkaspell_change_alt_dict(compose->gtkaspell,
- item->prefs->default_alt_dictionary);
- compose_spell_menu_changed(compose);
- }
+ compose_set_dictionaries_from_folder_prefs(compose, item);
#endif
if (account->auto_sig)
}
}
if (privacy != NULL) {
- compose->privacy_system = g_strdup(privacy);
+ if (compose->privacy_system == NULL)
+ compose->privacy_system = g_strdup(privacy);
compose_update_privacy_system_menu_item(compose, FALSE);
compose_use_encryption(compose, TRUE);
}
}
}
if (privacy != NULL) {
- compose->privacy_system = g_strdup(privacy);
+ if (compose->privacy_system == NULL)
+ compose->privacy_system = g_strdup(privacy);
compose_update_privacy_system_menu_item(compose, FALSE);
compose_use_signing(compose, TRUE);
}
undo_block(compose->undostruct);
#ifdef USE_ASPELL
- if (msginfo->folder && msginfo->folder->prefs &&
- msginfo->folder->prefs &&
- compose->gtkaspell) {
- if (msginfo->folder->prefs->enable_default_dictionary)
- gtkaspell_change_dict(compose->gtkaspell,
- msginfo->folder->prefs->default_dictionary, FALSE);
- if (msginfo->folder->prefs->enable_default_alt_dictionary)
- gtkaspell_change_alt_dict(compose->gtkaspell,
- msginfo->folder->prefs->default_alt_dictionary);
- compose_spell_menu_changed(compose);
- }
+ compose_set_dictionaries_from_folder_prefs(compose, msginfo->folder);
#endif
if (quote) {
child = (MimeInfo *) mimeinfo->node->children->data;
while (child != NULL) {
+ gint err;
+
if (child == encrypted) {
/* skip this part of tree */
NEXT_PART_NOT_CHILD(child);
}
outfile = procmime_get_tmp_file_name(child);
- if (procmime_get_part(outfile, child) < 0)
- g_warning("Can't get the part of multipart message.");
+ if ((err = procmime_get_part(outfile, child)) < 0)
+ g_warning("Can't get the part of multipart message. (%s)", strerror(-err));
else {
gchar *content_type;
/* 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")) {
partname = procmime_mimeinfo_get_parameter(child, "filename");
if (partname == NULL)
partname = procmime_mimeinfo_get_parameter(child, "name");
compose_insert_sig(compose, TRUE);
undo_unblock(compose->undostruct);
}
+
+#ifdef USE_ASPELL
+ /* use account's dict info if set */
+ if (compose->gtkaspell) {
+ if (account->enable_default_dictionary)
+ gtkaspell_change_dict(compose->gtkaspell,
+ account->default_dictionary, FALSE);
+ if (account->enable_default_alt_dictionary)
+ gtkaspell_change_alt_dict(compose->gtkaspell,
+ account->default_alt_dictionary);
+ if (account->enable_default_dictionary
+ || account->enable_default_alt_dictionary)
+ compose_spell_menu_changed(compose);
+ }
+#endif
}
gboolean compose_check_for_valid_recipient(Compose *compose) {
return newmsginfo;
}
+#ifdef USE_ASPELL
+/* update compose's dictionaries from folder dict settings */
+static void compose_set_dictionaries_from_folder_prefs(Compose *compose,
+ FolderItem *folder_item)
+{
+ g_return_if_fail(compose != NULL);
+
+ if (compose->gtkaspell && folder_item && folder_item->prefs) {
+ FolderItemPrefs *prefs = folder_item->prefs;
+
+ if (prefs->enable_default_dictionary)
+ gtkaspell_change_dict(compose->gtkaspell,
+ prefs->default_dictionary, FALSE);
+ if (folder_item->prefs->enable_default_alt_dictionary)
+ gtkaspell_change_alt_dict(compose->gtkaspell,
+ prefs->default_alt_dictionary);
+ if (prefs->enable_default_dictionary
+ || prefs->enable_default_alt_dictionary)
+ compose_spell_menu_changed(compose);
+ }
+}
+#endif
+
/*
* End of Source.
*/