/*
- * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2013 Hiroyuki Yamamoto & The Claws Mail Team
+ * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 1999-2015 Hiroyuki Yamamoto & The Claws Mail Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ *
*/
#ifdef HAVE_CONFIG_H
g_free(filename);
if (ret < 0) {
- alertpanel_error(_("Can't get part of multipart message: %s"), strerror(-ret));
+ alertpanel_error(_("Can't get part of multipart message: %s"), g_strerror(-ret));
g_free(part_filename);
return FALSE;
}
gint body_pos, MimeInfo *partinfo,
void (*callback)(void *data), void *data)
{
- GSList *children_list = NULL;
+ GSList *children_list = NULL, *cur = NULL;
gint is_ok = TRUE;
gint msg_list_len;
Children *children;
((action_type & ACTION_SINGLE) == 0 || msg_list_len == 1))
children->open_in = 1;
- if (action_type & ACTION_SINGLE) {
- GSList *cur;
+ /* Pre-fetch bodies, makes it easier on IMAP (see bug #3011) */
+ for (cur = msg_list; cur; cur = cur->next) {
+ gchar *dummy;
+ msginfo = (MsgInfo *)cur->data;
+
+ dummy = procmsg_get_message_file((MsgInfo *)cur->data);
+ if (dummy)
+ g_free(dummy);
+ else
+ is_ok = FALSE;
+ }
+ if (is_ok && (action_type & ACTION_SINGLE)) {
for (cur = msg_list; cur && is_ok == TRUE; cur = cur->next) {
msginfo = (MsgInfo *)cur->data;
if (!msginfo) {
}
g_free(cmd);
}
- } else {
+ } else if (is_ok) {
cmd = parse_action_cmd(action, NULL, msg_list, partinfo,
user_str, user_hidden_str, sel_str);
if (cmd) {
r = close(chld_in);
child_info->chld_in = -1; /* No more input */
if (r != 0)
- debug_print("%s(%d)", strerror(errno), errno);
+ debug_print("%s(%d)", g_strerror(errno), errno);
}
return child_info;
modified_something = TRUE;
last_item = nmi->folder;
}
- procmsg_msginfo_free (nmi);
+ procmsg_msginfo_free (&nmi);
if (summaryview && summaryview->displayed &&
summaryview->folder_item == msginfo->folder &&
summary_get_msgnum(summaryview, summaryview->displayed) == msginfo->msgnum)
r = close(child_info->chld_in);
child_info->chld_in = -1;
if (r != 0)
- debug_print("%s(%d)", strerror(errno), errno);
+ debug_print("%s(%d)", g_strerror(errno), errno);
child_info->chld_in = -1;
debug_print("Input to grand child sent.\n");
}