return compose;
}
+static void compose_force_encryption(Compose *compose, PrefsAccount *account,
+ gboolean override_pref)
+{
+ gchar *privacy = NULL;
+
+ if (override_pref == FALSE && account->default_encrypt_reply == FALSE)
+ return;
+
+ if (account->default_privacy_system
+ && strlen(account->default_privacy_system)) {
+ privacy = account->default_privacy_system;
+ } else {
+ GSList *privacy_avail = privacy_get_system_ids();
+ if (privacy_avail && g_slist_length(privacy_avail)) {
+ privacy = (gchar *)(privacy_avail->data);
+ }
+ }
+ if (privacy != NULL) {
+ compose->privacy_system = g_strdup(privacy);
+ compose_update_privacy_system_menu_item(compose);
+ compose_use_encryption(compose, TRUE);
+ }
+}
+
void compose_reply_mode(ComposeMode mode, GSList *msginfo_list, gchar *body)
{
MsgInfo *msginfo;
prefs_common.quotefmt,
qmark, body);
}
+ if (procmime_msginfo_is_encrypted(compose->replyinfo)) {
+ compose_force_encryption(compose, account, FALSE);
+ }
if (account->auto_sig)
compose_insert_sig(compose, FALSE);
g_signal_handlers_block_by_func(G_OBJECT(textbuf),
G_CALLBACK(compose_changed_cb),
compose);
-
- if ((fp = procmime_get_first_text_content(msginfo)) == NULL)
+
+ if (procmime_msginfo_is_encrypted(msginfo)) {
+ fp = procmime_get_first_encrypted_text_content(msginfo);
+ if (fp)
+ compose_force_encryption(compose, account, TRUE);
+ } else
+ fp = procmime_get_first_text_content(msginfo);
+ if (fp == NULL)
g_warning("Can't get text part\n");
- else {
+
+ if (fp != NULL) {
gboolean prev_autowrap = compose->autowrap;
compose->autowrap = FALSE;
} else if (compose->mode == COMPOSE_REEDIT &&
child->type == MIMETYPE_APPLICATION &&
!g_ascii_strcasecmp(child->subtype, "pgp-encrypted")) {
- AlertValue val;
- val = alertpanel(_("Encrypted message"),
- _("Cannot re-edit an encrypted message. \n"
- "Discard encrypted part?"),
- _("Yes"), _("No"), NULL);
- if (val == G_ALERTDEFAULT)
- encrypted = (MimeInfo *)child->node->parent->data;
+ encrypted = (MimeInfo *)child->node->parent->data;
}
child = (MimeInfo *) mimeinfo->node->children->data;
gint pos = 0;
gboolean can_break = FALSE;
gboolean do_break = FALSE;
+ gboolean was_white = FALSE;
gtk_text_iter_forward_to_line_end(&line_end);
str = gtk_text_buffer_get_text(buffer, &iter, &line_end, FALSE);
gunichar wc;
gint uri_len;
- if (attr->is_line_break && can_break)
+ if (attr->is_line_break && can_break && was_white)
pos = i;
+
+ was_white = attr->is_white;
/* don't wrap URI */
if ((uri_len = get_uri_len(p)) > 0) {
handlebox = gtk_handle_box_new();
gtk_box_pack_start(GTK_BOX(vbox), handlebox, FALSE, FALSE, 0);
+ gtk_widget_realize(handlebox);
compose->toolbar = toolbar_create(TOOLBAR_COMPOSE, handlebox,
(gpointer)compose);