From: Paul Mangan Date: Wed, 3 Apr 2002 08:58:44 +0000 (+0000) Subject: sync with 0.7.4cvs29 X-Git-Tag: rel_0_7_5~64 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=5da4e7cf55afbbdd1e527fd29edeb77c6b07a519 sync with 0.7.4cvs29 --- diff --git a/ChangeLog b/ChangeLog index 93a10624c..ece06d15e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,34 @@ +2002-04-03 + + * src/imap.c: imap_parse_atom(): fixed a bug that cur_pos didn't + point the correct address after reading the continuous line. + imap_scan_folder(): set new number to 0 if unseen number is 0. + imap_parse_flags(): don't add new and unread flag if \Seen flag + exists. + * ac/Makefile.am: removed gpgme.m4 from MACROS. + +2002-04-02 + + * fixed the old problem that couldn't add flags to currently opened + folders. + * src/compose.c: + compose_send(): update outbox after saving. + compose_queue() + compose_draft_cb(): use procmsg_add_flags(). + * src/folder.[ch]: added "opened" flag and "mark_queue" list to + FolderItem. + * src/main.c: send_queue(): send from all queue folders. + * src/mainwindow.c: send_queue_cb(): send from all queue folders. + * src/procmsg.[ch]: + procmsg_flush_mark_queue(): new. Write all queued flags into file. + procmsg_add_flags(): new. Add specified flags to the folder. + procmsg_send_queue(): added an argument to specify queue folder. + procmsg_save_to_outbox(): use procmsg_add_flags(). + * src/summaryview.c: + summary_show(): up the opened flag of FolderItem. + summary_clear_list(): down the opened flag of FolderItem. + summary_write_cache(): call procmsg_flush_mark_queue(). + 2002-04-01 * src/summaryview.[ch]: trim the tail of folder name and selected diff --git a/ChangeLog.claws b/ChangeLog.claws index 8593ece2b..b8f8ad8b4 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -1,3 +1,8 @@ +2002-04-03 [paul] 0.7.4claws63 + + * sync with 0.7.4cvs29 + see ChangeLog entries 2002-04-02 and 2002-04-03 + 2002-04-02 [paul] 0.7.4claws62 * sync with 0.7.4cvs26 diff --git a/ChangeLog.jp b/ChangeLog.jp index 9b1e5bf54..41667098d 100644 --- a/ChangeLog.jp +++ b/ChangeLog.jp @@ -1,3 +1,34 @@ +2002-04-03 + + * src/imap.c: imap_parse_atom(): ·Ñ³¹Ô¤òÆɤó¤À¸å¤Ë cur_pos ¤¬Àµ¤·¤¤ + ¥¢¥É¥ì¥¹¤ò»Ø¤·¤Æ¤¤¤Ê¤«¤Ã¤¿¥Ð¥°¤ò½¤Àµ¡£ + imap_scan_folder(): ̤ÆÉ¿ô¤¬0¤Î¤È¤­¤Ï¿·Ãå¿ô¤ò0¤Ë¥»¥Ã¥È¡£ + imap_parse_flags(): \Seen ¥Õ¥é¥°¤¬Â¸ºß¤¹¤ì¤Ð¿·Ã塦̤Æɥե饰¤ò + Äɲ䷤ʤ¤¤è¤¦¤Ë¤·¤¿¡£ + * ac/Makefile.am: MACROS ¤«¤é gpgme.m4 ¤òºï½ü¡£ + +2002-04-02 + + * ¸½ºß³«¤¤¤Æ¤¤¤ë¥Õ¥©¥ë¥À¤Ë¥Õ¥é¥°¤òÄɲäǤ­¤Ê¤¤ÌäÂê¤ò½¤Àµ¡£ + * src/compose.c: + compose_send(): Êݸ¸å outbox ¤ò¹¹¿·¡£ + compose_queue() + compose_draft_cb(): procmsg_add_flags() ¤ò»ÈÍÑ¡£ + * src/folder.[ch]: FolderItem ¤Ë "opened" ¥Õ¥é¥°¤È "mark_queue" + ¥ê¥¹¥È¤òÄɲᣠ+ * src/main.c: send_queue(): Á´¤Æ¤Î queue ¥Õ¥©¥ë¥À¤«¤éÁ÷¿®¡£ + * src/mainwindow.c: send_queue_cb(): Á´¤Æ¤Î queue ¥Õ¥©¥ë¥À¤«¤éÁ÷¿®¡£ + * src/procmsg.[ch]: + procmsg_flush_mark_queue(): ¿·µ¬¡£Á´¤Æ¤ÎÂÔ¤Á¾õÂ֤Υե饰¤ò¥Õ¥¡¥¤¥ë + ¤Ë½ñ¤­½Ð¤¹¡£ + procmsg_add_flags(): ¿·µ¬¡£¥Õ¥©¥ë¥À¤Ë»ØÄꤵ¤ì¤¿¥Õ¥é¥°¤òÄɲᣠ+ procmsg_send_queue(): Á÷¿®ÂÔ¤Á¥Õ¥©¥ë¥À¤ò»ØÄꤹ¤ë¤¿¤á¤Î°ú¿ô¤òÄɲᣠ+ procmsg_save_to_outbox(): procmsg_add_flags() ¤ò»ÈÍÑ¡£ + * src/summaryview.c: + summary_show(): FolderItem ¤Î opened ¥Õ¥é¥°¤òΩ¤Æ¤ë¡£ + summary_clear_list(): FolderItem ¤Î opened ¥Õ¥é¥°¤ò²¼¤²¤ë¡£ + summary_write_cache(): procmsg_flush_mark_queue() ¤ò¸Æ¤Ö¤è¤¦¤Ë¤·¤¿¡£ + 2002-04-01 * src/summaryview.[ch]: ¥¹¥Ú¡¼¥¹¤¬½½Ê¬¤Ë¤Ê¤±¤ì¤Ð¥¹¥Æ¡¼¥¿¥¹¥é¥Ù¥ë¤Î diff --git a/ac/Makefile.am b/ac/Makefile.am index 3a41ec4e3..08d9a7e7d 100644 --- a/ac/Makefile.am +++ b/ac/Makefile.am @@ -2,7 +2,6 @@ MACROS = \ aclocal-include.m4 \ check-type.m4 \ gnupg-check-typedef.m4 \ - gpgme.m4 \ pspell.m4 EXTRA_DIST = $(MACROS) diff --git a/configure.in b/configure.in index e5411b94f..03b9fad0f 100644 --- a/configure.in +++ b/configure.in @@ -8,7 +8,7 @@ MINOR_VERSION=7 MICRO_VERSION=4 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=claws62 +EXTRA_VERSION=claws63 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION dnl set $target diff --git a/src/compose.c b/src/compose.c index d2047e562..95716026b 100644 --- a/src/compose.c +++ b/src/compose.c @@ -2784,9 +2784,13 @@ gint compose_send(Compose *compose) if (folder) outbox = folder->outbox; + if (!outbox) + outbox = folder_get_default_outbox(); if (procmsg_save_to_outbox(outbox, tmp, FALSE) < 0) alertpanel_error (_("Can't save the message to outbox.")); + else + folderview_update_item(outbox, TRUE); } } @@ -3216,6 +3220,7 @@ static gint compose_queue(Compose *compose, gint *msgnum, FolderItem **item) GSList *cur; gchar buf[BUFFSIZE]; gint num; + MsgFlags flag = {0, 0}; static gboolean lock = FALSE; PrefsAccount *mailac = NULL, *newsac = NULL; @@ -3413,19 +3418,7 @@ static gint compose_queue(Compose *compose, gint *msgnum, FolderItem **item) (compose->targetinfo->folder, TRUE); } - if ((fp = procmsg_open_mark_file(queue_path, TRUE)) == NULL) - g_warning(_("can't open mark file\n")); - else { - MsgInfo newmsginfo; - - newmsginfo.msgnum = num; - newmsginfo.flags.perm_flags = 0; - newmsginfo.flags.tmp_flags = 0; - procmsg_write_flags(&newmsginfo, fp); - fclose(fp); - } - g_free(queue_path); - + procmsg_add_flags(queue, num, flag); folder_item_scan(queue); folderview_update_item(queue, TRUE); @@ -5936,8 +5929,7 @@ static void compose_draft_cb(gpointer data, guint action, GtkWidget *widget) FolderItem *draft; gchar *tmp; gint msgnum; - gchar *draft_path; - FILE *fp; + MsgFlags flag = {0, 0}; static gboolean lock = FALSE; if (lock) return; @@ -5978,20 +5970,7 @@ static void compose_draft_cb(gpointer data, guint action, GtkWidget *widget) TRUE); } - draft_path = folder_item_get_path(draft); - if ((fp = procmsg_open_mark_file(draft_path, TRUE)) == NULL) - g_warning(_("can't open mark file\n")); - else { - MsgInfo newmsginfo; - - newmsginfo.msgnum = msgnum; - newmsginfo.flags.perm_flags = 0; - newmsginfo.flags.tmp_flags = 0; - procmsg_write_flags(&newmsginfo, fp); - fclose(fp); - } - g_free(draft_path); - + procmsg_add_flags(draft, msgnum, flag); folder_item_scan(draft); folderview_update_item(draft, TRUE); diff --git a/src/folder.c b/src/folder.c index b7dddb229..8e200ec30 100644 --- a/src/folder.c +++ b/src/folder.c @@ -198,8 +198,10 @@ FolderItem *folder_item_new(const gchar *name, const gchar *path) item->collapsed = FALSE; item->threaded = TRUE; item->ret_rcpt = FALSE; + item->opened = FALSE; item->parent = NULL; item->folder = NULL; + item->mark_queue = NULL; item->data = NULL; item->prefs = prefs_folder_item_new(); diff --git a/src/folder.h b/src/folder.h index f7897cbbe..ed79686de 100644 --- a/src/folder.h +++ b/src/folder.h @@ -201,11 +201,14 @@ struct _FolderItem guint ret_rcpt : 1; /* return receipt */ gint op_count; + guint opened : 1; /* opened by summary view */ FolderItem *parent; Folder *folder; + GSList *mark_queue; + gpointer data; PrefsFolderItem * prefs; diff --git a/src/main.c b/src/main.c index a9530ea85..c27cf0054 100644 --- a/src/main.c +++ b/src/main.c @@ -568,19 +568,28 @@ static void open_compose_new_with_recipient(const gchar *address) static void send_queue(void) { GList *list; + FolderItem *def_outbox; - if (procmsg_send_queue(prefs_common.savemsg) < 0) - alertpanel_error(_("Some errors occurred while sending queued messages.")); - - statusbar_pop_all(); + def_outbox = folder_get_default_outbox(); for (list = folder_get_list(); list != NULL; list = list->next) { - Folder *folder; + Folder *folder = list->data; - folder = list->data; if (folder->queue) { + if (procmsg_send_queue + (folder->queue, prefs_common.savemsg) < 0) + alertpanel_error(_("Some errors occurred while sending queued messages.")); + statusbar_pop_all(); folder_item_scan(folder->queue); folderview_update_item(folder->queue, TRUE); + if (prefs_common.savemsg && folder->outbox) { + folderview_update_item(folder->outbox, TRUE); + if (folder->outbox == def_outbox) + def_outbox = NULL; + } } } + + if (prefs_common.savemsg && def_outbox) + folderview_update_item(def_outbox, TRUE); } diff --git a/src/mainwindow.c b/src/mainwindow.c index fb23b9abb..fd6540996 100644 --- a/src/mainwindow.c +++ b/src/mainwindow.c @@ -2574,16 +2574,14 @@ static void send_queue_cb(MainWindow *mainwin, guint action, GtkWidget *widget) { GList *list; - if (procmsg_send_queue(prefs_common.savemsg) < 0) - alertpanel_error(_("Some errors occurred while sending queued messages.")); - - statusbar_pop_all(); - for (list = folder_get_list(); list != NULL; list = list->next) { - Folder *folder; + Folder *folder = list->data; - folder = list->data; if (folder->queue) { + if (procmsg_send_queue + (folder->queue, prefs_common.savemsg) < 0) + alertpanel_error(_("Some errors occurred while sending queued messages.")); + statusbar_pop_all(); folder_item_scan(folder->queue); folderview_update_item(folder->queue, TRUE); } diff --git a/src/procmsg.c b/src/procmsg.c index c27571269..9a235d1f3 100644 --- a/src/procmsg.c +++ b/src/procmsg.c @@ -400,6 +400,57 @@ void procmsg_write_flags(MsgInfo *msginfo, FILE *fp) WRITE_CACHE_DATA_INT(flags, fp); } +void procmsg_flush_mark_queue(FolderItem *item, FILE *fp) +{ + MsgInfo *flaginfo; + + g_return_if_fail(item != NULL); + g_return_if_fail(fp != NULL); + + while (item->mark_queue != NULL) { + flaginfo = (MsgInfo *)item->mark_queue->data; + procmsg_write_flags(flaginfo, fp); + procmsg_msginfo_free(flaginfo); + item->mark_queue = g_slist_remove(item->mark_queue, flaginfo); + } +} + +void procmsg_add_flags(FolderItem *item, gint num, MsgFlags flags) +{ + FILE *fp; + gchar *path; + MsgInfo msginfo; + + g_return_if_fail(item != NULL); + + if (item->opened) { + MsgInfo *queue_msginfo; + + queue_msginfo = g_new0(MsgInfo, 1); + queue_msginfo->msgnum = num; + queue_msginfo->flags = flags; + item->mark_queue = g_slist_append + (item->mark_queue, queue_msginfo); + return; + } + + path = folder_item_get_path(item); + g_return_if_fail(path != NULL); + + if ((fp = procmsg_open_mark_file(path, TRUE)) == NULL) { + g_warning(_("can't open mark file\n")); + g_free(path); + return; + } + g_free(path); + + msginfo.msgnum = num; + msginfo.flags = flags; + + procmsg_write_flags(&msginfo, fp); + fclose(fp); +} + struct MarkSum { gint *new; gint *unread; @@ -828,14 +879,15 @@ void procmsg_empty_trash(void) } } -gint procmsg_send_queue(gboolean save_msgs) +gint procmsg_send_queue(FolderItem *queue, gboolean save_msgs) { - FolderItem *queue; gint i; gint ret = 0; - queue = folder_get_default_queue(); + if (!queue) + queue = folder_get_default_queue(); g_return_val_if_fail(queue != NULL, -1); + folder_item_scan(queue); if (queue->last_num < 0) return -1; else if (queue->last_num == 0) return 0; @@ -873,7 +925,7 @@ gint procmsg_save_to_outbox(FolderItem *outbox, const gchar *file, { gint num; FILE *fp; - gchar *path; + MsgFlags flag = {0, 0}; debug_print(_("saving sent message...\n")); @@ -917,19 +969,7 @@ gint procmsg_save_to_outbox(FolderItem *outbox, const gchar *file, unlink(file); } - path = folder_item_get_path(outbox); - if ((fp = procmsg_open_mark_file(path, TRUE)) == NULL) - g_warning(_("can't open mark file\n")); - else { - MsgInfo newmsginfo; - - newmsginfo.msgnum = num; - newmsginfo.flags.perm_flags = 0; - newmsginfo.flags.tmp_flags = 0; - procmsg_write_flags(&newmsginfo, fp); - fclose(fp); - } - g_free(path); + procmsg_add_flags(outbox, num, flag); return 0; } diff --git a/src/procmsg.h b/src/procmsg.h index e30578ad3..f0e4b2164 100644 --- a/src/procmsg.h +++ b/src/procmsg.h @@ -217,6 +217,11 @@ void procmsg_write_cache (MsgInfo *msginfo, FILE *fp); void procmsg_write_flags (MsgInfo *msginfo, FILE *fp); +void procmsg_flush_mark_queue (FolderItem *item, + FILE *fp); +void procmsg_add_flags (FolderItem *item, + gint num, + MsgFlags flags); void procmsg_get_mark_sum (const gchar *folder, gint *new, gint *unread, @@ -242,7 +247,8 @@ FILE *procmsg_open_message_decrypted (MsgInfo *msginfo, gboolean procmsg_msg_exist (MsgInfo *msginfo); void procmsg_empty_trash (void); -gint procmsg_send_queue (gboolean save_msgs); +gint procmsg_send_queue (FolderItem *queue, + gboolean save_msgs); gint procmsg_save_to_outbox (FolderItem *outbox, const gchar *file, gboolean is_queued); diff --git a/src/summaryview.c b/src/summaryview.c index 75fc8e25d..b42cdfa6a 100644 --- a/src/summaryview.c +++ b/src/summaryview.c @@ -774,6 +774,7 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item, g_free(buf); summaryview->folder_item = item; + item->opened = TRUE; gtk_signal_handler_block_by_data(GTK_OBJECT(ctree), summaryview); @@ -951,7 +952,10 @@ void summary_clear_list(SummaryView *summaryview) gtk_ctree_pre_recursive(GTK_CTREE(summaryview->ctree), NULL, summary_free_msginfo_func, NULL); - summaryview->folder_item = NULL; + if (summaryview->folder_item) { + summaryview->folder_item->opened = FALSE; + summaryview->folder_item = NULL; + } summaryview->display_msg = FALSE; @@ -2171,13 +2175,7 @@ gint summary_write_cache(SummaryView *summaryview) gtk_ctree_pre_recursive(ctree, NULL, summary_write_cache_func, &fps); - for(cur = summaryview->killed_messages ; cur != NULL ; - cur = g_slist_next(cur)) { - MsgInfo *msginfo = (MsgInfo *) cur->data; - - procmsg_write_cache(msginfo, fps.cache_fp); - procmsg_write_flags(msginfo, fps.mark_fp); - } + procmsg_flush_mark_queue(summaryview->folder_item, fps.mark_fp); fclose(fps.cache_fp); fclose(fps.mark_fp);