X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=blobdiff_plain;f=src%2Fprocmsg.c;h=d787a3164f177e8d041af101ddf5dd42d4aacd40;hp=2515c29178f6ca2e2a4269c20627d141863ce3a2;hb=abbd7a7a3cc83056b2bf76322598698d0f1730e3;hpb=eadd92728144563a134a2ce127ea8b34820fe6d3 diff --git a/src/procmsg.c b/src/procmsg.c index 2515c2917..d787a3164 100644 --- a/src/procmsg.c +++ b/src/procmsg.c @@ -898,7 +898,7 @@ gint procmsg_save_to_outbox(FolderItem *outbox, const gchar *file, FILE *fp; MsgInfo *msginfo; - debug_print(_("saving sent message...\n")); + debug_print("saving sent message...\n"); if (!outbox) outbox = folder_get_default_outbox(); @@ -927,13 +927,18 @@ gint procmsg_save_to_outbox(FolderItem *outbox, const gchar *file, fputs(buf, outfp); fclose(outfp); fclose(fp); - Xstrdup_a(file, tmp, return -1); - } - if ((num = folder_item_add_msg(outbox, file, FALSE)) < 0) { - g_warning(_("can't save message\n")); - if(is_queued) { - unlink(file); + folder_item_scan(outbox); + if ((num = folder_item_add_msg(outbox, tmp, TRUE)) < 0) { + g_warning("can't save message\n"); + unlink(tmp); + return -1; + } + } else { + folder_item_scan(outbox); + if ((num = folder_item_add_msg(outbox, file, FALSE)) < 0) { + g_warning("can't save message\n"); + return -1; } return -1; }