if (override_pref == FALSE && account->default_encrypt_reply == FALSE)
return;
- if (system)
- privacy = system;
- else if (account->default_privacy_system
- && strlen(account->default_privacy_system)) {
+ if (account->default_privacy_system && strlen(account->default_privacy_system))
privacy = account->default_privacy_system;
- } else {
+ else if (system)
+ privacy = system;
+ else {
GSList *privacy_avail = privacy_get_system_ids();
if (privacy_avail && g_slist_length(privacy_avail)) {
privacy = (gchar *)(privacy_avail->data);
{
const gchar *privacy = NULL;
- if (system)
- privacy = system;
- else if (account->default_privacy_system
- && strlen(account->default_privacy_system)) {
+ if (account->default_privacy_system && strlen(account->default_privacy_system))
privacy = account->default_privacy_system;
- } else {
+ else if (system)
+ privacy = system;
+ else {
GSList *privacy_avail = privacy_get_system_ids();
if (privacy_avail && g_slist_length(privacy_avail)) {
privacy = (gchar *)(privacy_avail->data);
return FALSE;
}
- if (!compose->batch) {
+ if (!compose->batch && prefs_common.warn_empty_subj == TRUE) {
str = gtk_entry_get_text(GTK_ENTRY(compose->subject_entry));
- if (*str == '\0' && check_everything == TRUE &&
+ if (*str == '\0' && check_everything == TRUE &&
compose->mode != COMPOSE_REDIRECT) {
AlertValue aval;
gchar *button_label;
compose->sending?_("Send it anyway?"):
_("Queue it anyway?"));
- aval = alertpanel(compose->sending?_("Send"):_("Send later"), message,
- GTK_STOCK_CANCEL, button_label, NULL);
+ aval = alertpanel_full(compose->sending?_("Send"):_("Send later"), message,
+ GTK_STOCK_CANCEL, button_label, NULL, TRUE, NULL,
+ ALERT_QUESTION, G_ALERTDEFAULT);
g_free(message);
+ if (aval & G_ALERTDISABLE) {
+ aval &= ~G_ALERTDISABLE;
+ prefs_common.warn_empty_subj = FALSE;
+ }
if (aval != G_ALERTALTERNATE)
return FALSE;
}
return 0;
}
+static gchar *compose_quote_list_of_addresses(gchar *str)
+{
+ GSList *list = NULL, *item = NULL;
+ gchar *qname = NULL, *faddr = NULL, *result = NULL;
+
+ list = address_list_append_with_comments(list, str);
+ for (item = list; item != NULL; item = item->next) {
+ gchar *spec = item->data;
+ gchar *endofname = strstr(spec, " <");
+ *endofname = '\0';
+ QUOTE_IF_REQUIRED_NORMAL(qname, spec, return NULL);
+ *endofname = ' ';
+ if (*qname != *spec) { /* has been quoted, compute new */
+ gchar *addr = g_strdup(endofname);
+ gchar *name = g_strdup(qname);
+ faddr = g_strconcat(name, addr, NULL);
+ g_free(name);
+ g_free(addr);
+ debug_print("new auto-quoted address: '%s'", faddr);
+ }
+ if (result == NULL)
+ result = g_strdup((faddr != NULL)? faddr: spec);
+ else {
+ result = g_strconcat(result,
+ ", ",
+ (faddr != NULL)? faddr: spec,
+ NULL);
+ }
+ if (faddr != NULL) {
+ g_free(faddr);
+ faddr = NULL;
+ }
+ }
+ slist_free_strings_full(list);
+
+ return result;
+}
+
#define IS_IN_CUSTOM_HEADER(header) \
(compose->account->add_customhdr && \
custom_header_find(compose->account->customhdr_list, header) != NULL)
headerentryname = gtk_entry_get_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN((headerentry->combo)))));
if (!g_utf8_collate(trans_fieldname, headerentryname)) {
- str = gtk_editable_get_chars(GTK_EDITABLE(headerentry->entry), 0, -1);
- g_strstrip(str);
- if (str[0] != '\0') {
+ gchar * ustr = gtk_editable_get_chars(GTK_EDITABLE(headerentry->entry), 0, -1);
+ g_strstrip(ustr);
+ str = compose_quote_list_of_addresses(ustr);
+ g_free(ustr);
+ if (str != NULL && str[0] != '\0') {
if (add_field)
g_string_append(fieldstr, seperator);
g_string_append(fieldstr, str);