From: Hiroyuki Yamamoto Date: Thu, 2 May 2002 01:53:39 +0000 (+0000) Subject: fixed crash on reply and IMAP queue folder malfunction. X-Git-Tag: w32-075claws17-0~16 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=b3e37c095a19018f36db94d2f47982a0d429ca7f fixed crash on reply and IMAP queue folder malfunction. --- diff --git a/ChangeLog.claws b/ChangeLog.claws index 44b2a2ea1..beaad1520 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -1,3 +1,14 @@ +2002-05-02 [hiro] 0.7.5claws4 + + * src/compose.c + compose_queue_sub(): + check if queue folder exists (closes #550397). + removed directory creation since it should be handled + transparently. + * src/imap.c + imap_add_msg(): return UID for appended message + (closes #548842). + 2002-04-30 [paul] 0.7.5claws3 * src/summaryview.c diff --git a/configure.in b/configure.in index 9f02652e8..c4804969c 100644 --- a/configure.in +++ b/configure.in @@ -8,7 +8,7 @@ MINOR_VERSION=7 MICRO_VERSION=5 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=claws3 +EXTRA_VERSION=claws4 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION dnl set $target diff --git a/src/compose.c b/src/compose.c index 02033164d..4d239cd38 100644 --- a/src/compose.c +++ b/src/compose.c @@ -3225,7 +3225,7 @@ static gint compose_queue(Compose *compose, gint *msgnum, FolderItem **item) static gint compose_queue_sub(Compose *compose, gint *msgnum, FolderItem **item, gboolean check_subject) { FolderItem *queue; - gchar *tmp, *tmp2, *queue_path; + gchar *tmp, *tmp2; FILE *fp, *src_fp; GSList *cur; gchar buf[BUFFSIZE]; @@ -3399,15 +3399,17 @@ static gint compose_queue_sub(Compose *compose, gint *msgnum, FolderItem **item, } queue = account_get_special_folder(compose->account, F_QUEUE); + if (!queue) { + g_warning(_("can't find queue folder\n")); + unlink(tmp); + g_free(tmp); + return -1; + } folder_item_scan(queue); - queue_path = folder_item_get_path(queue); - if (!is_dir_exist(queue_path)) - make_dir_hier(queue_path); if ((num = folder_item_add_msg(queue, tmp, TRUE)) < 0) { g_warning(_("can't queue the message\n")); unlink(tmp); g_free(tmp); - g_free(queue_path); return -1; } unlink(tmp); diff --git a/src/imap.c b/src/imap.c index 35fd86c83..a77993533 100644 --- a/src/imap.c +++ b/src/imap.c @@ -618,6 +618,8 @@ gint imap_add_msg(Folder *folder, FolderItem *dest, const gchar *file, { gchar *destdir; IMAPSession *session; + gint messages, recent, unseen; + guint32 uid_next, uid_validity; gint ok; g_return_val_if_fail(folder != NULL, -1); @@ -627,6 +629,14 @@ gint imap_add_msg(Folder *folder, FolderItem *dest, const gchar *file, session = imap_session_get(folder); if (!session) return -1; + ok = imap_status(session, IMAP_FOLDER(folder), dest->path, + &messages, &recent, &uid_next, &uid_validity, &unseen); + statusbar_pop_all(); + if (ok != IMAP_SUCCESS) { + g_warning(_("can't append message %s\n"), file); + return -1; + } + destdir = imap_get_real_path(IMAP_FOLDER(folder), dest->path); ok = imap_cmd_append(SESSION(session)->sock, destdir, file); g_free(destdir); @@ -641,7 +651,7 @@ gint imap_add_msg(Folder *folder, FolderItem *dest, const gchar *file, FILE_OP_ERROR(file, "unlink"); } - return 0; + return uid_next; } static gint imap_do_copy(Folder *folder, FolderItem *dest, MsgInfo *msginfo,