}
static void compose_force_encryption(Compose *compose, PrefsAccount *account,
- gboolean override_pref)
+ gboolean override_pref, const gchar *system)
{
- gchar *privacy = NULL;
+ const gchar *privacy = NULL;
g_return_if_fail(compose != NULL);
g_return_if_fail(account != NULL);
if (override_pref == FALSE && account->default_encrypt_reply == FALSE)
return;
- if (account->default_privacy_system
+ if (system)
+ privacy = system;
+ else if (account->default_privacy_system
&& strlen(account->default_privacy_system)) {
privacy = account->default_privacy_system;
} else {
}
}
if (privacy != NULL) {
+ if (system) {
+ g_free(compose->privacy_system);
+ compose->privacy_system = NULL;
+ }
if (compose->privacy_system == NULL)
compose->privacy_system = g_strdup(privacy);
else if (*(compose->privacy_system) == '\0') {
}
}
-static void compose_force_signing(Compose *compose, PrefsAccount *account)
+static void compose_force_signing(Compose *compose, PrefsAccount *account, const gchar *system)
{
gchar *privacy = NULL;
- if (account->default_privacy_system
+ if (system)
+ privacy = system;
+ else if (account->default_privacy_system
&& strlen(account->default_privacy_system)) {
privacy = account->default_privacy_system;
} else {
privacy = (gchar *)(privacy_avail->data);
}
}
+
if (privacy != NULL) {
+ if (system) {
+ g_free(compose->privacy_system);
+ compose->privacy_system = NULL;
+ }
if (compose->privacy_system == NULL)
compose->privacy_system = g_strdup(privacy);
compose_update_privacy_system_menu_item(compose, FALSE);
gboolean quote = FALSE;
const gchar *qmark = NULL;
const gchar *body_fmt = NULL;
+ gchar *s_system = NULL;
START_TIMING("");
g_return_val_if_fail(msginfo != NULL, NULL);
g_return_val_if_fail(msginfo->folder != NULL, NULL);
}
if (MSG_IS_ENCRYPTED(compose->replyinfo->flags)) {
- compose_force_encryption(compose, account, FALSE);
+ compose_force_encryption(compose, account, FALSE, s_system);
}
- privacy_msginfo_get_signed_state(compose->replyinfo);
+ privacy_msginfo_get_signed_state(compose->replyinfo, &s_system);
if (MSG_IS_SIGNED(compose->replyinfo->flags) && account->default_sign_reply) {
- compose_force_signing(compose, account);
+ compose_force_signing(compose, account, s_system);
}
+ g_free(s_system);
SIGNAL_BLOCK(textbuf);
if (MSG_IS_ENCRYPTED(msginfo->flags)) {
fp = procmime_get_first_encrypted_text_content(msginfo);
if (fp) {
- compose_force_encryption(compose, account, TRUE);
+ compose_force_encryption(compose, account, TRUE, NULL);
}
} else {
fp = procmime_get_first_text_content(msginfo);
compose_attach_append(compose, outfile,
partname, content_type);
} else {
- compose_force_signing(compose, compose->account);
+ compose_force_signing(compose, compose->account, NULL);
}
g_free(content_type);
}
can_break = TRUE;
}
- debug_print("compose_get_line_break_pos(): do_break = %d, pos = %d, col = %d\n", do_break, pos, col);
+// debug_print("compose_get_line_break_pos(): do_break = %d, pos = %d, col = %d\n", do_break, pos, col);
g_free(attrs);
g_free(str);
quote_str = compose_get_quote_str(buffer, &iter, "e_len);
if (quote_str) {
- debug_print("compose_beautify_paragraph(): quote_str = '%s'\n", quote_str);
+// debug_print("compose_beautify_paragraph(): quote_str = '%s'\n", quote_str);
if (startq_offset == -1)
startq_offset = gtk_text_iter_get_offset(&iter);
quotelevel = get_quote_level(quote_str, prefs_common.quote_chars);
}
}
if (!modified) {
- debug_print("not modified, out after %d lines\n", lines);
+// debug_print("not modified, out after %d lines\n", lines);
goto end;
}
}
- debug_print("modified, out after %d lines\n", lines);
+// debug_print("modified, out after %d lines\n", lines);
end:
g_free(itemized_chars);
if (par_iter)
static void compose_changed_cb(GtkTextBuffer *textbuf, Compose *compose)
{
compose->modified = TRUE;
+// compose_beautify_paragraph(compose, NULL, TRUE);
#ifndef GENERIC_UMPC
compose_set_title(compose);
#endif
/* strangely, testing data->type == gdk_atom_intern("text/uri-list", TRUE)
* does not work */
debug_print("drop: %s (%s)\n", gdk_atom_name(data->type)?gdk_atom_name(data->type):"nul",
- data->data?data->data:"nul");
+ (gchar *)(data->data?data->data:"nul"));
#ifndef G_OS_WIN32
if (gdk_atom_name(data->type) && !strcmp(gdk_atom_name(data->type), "text/uri-list")) {
#else
list = uri_list_extract_filenames((const gchar *)data->data);
debug_print("list: %p (%s)\n", list,
- data->data?data->data:"nul");
+ (gchar *)(data->data?data->data:"nul"));
if (list == NULL && strstr((gchar *)(data->data), "://")) {
/* Assume a list of no files, and data has ://, is a remote link */
gchar *tmpdata = g_strstrip(g_strdup((const gchar *)data->data));
gboolean originally_enc = FALSE;
gboolean originally_sig = FALSE;
Compose *compose = NULL;
+ gchar *s_system = NULL;
g_return_if_fail(msgview != NULL);
new_msglist = g_slist_append(NULL, tmp_msginfo);
originally_enc = MSG_IS_ENCRYPTED(orig_msginfo->flags);
- privacy_msginfo_get_signed_state(orig_msginfo);
+ privacy_msginfo_get_signed_state(orig_msginfo, &s_system);
originally_sig = MSG_IS_SIGNED(orig_msginfo->flags);
tmp_msginfo->folder = orig_msginfo->folder;
compose = compose_reply_mode((ComposeMode)action, msginfo_list, body);
if (compose && originally_enc) {
- compose_force_encryption(compose, compose->account, FALSE);
+ compose_force_encryption(compose, compose->account, FALSE, s_system);
}
if (compose && originally_sig && compose->account->default_sign_reply) {
- compose_force_signing(compose, compose->account);
+ compose_force_signing(compose, compose->account, s_system);
}
-
+ g_free(s_system);
g_free(body);
}