sync with 0.8.5
authorPaul Mangan <paul@claws-mail.org>
Fri, 4 Oct 2002 15:35:49 +0000 (15:35 +0000)
committerPaul Mangan <paul@claws-mail.org>
Fri, 4 Oct 2002 15:35:49 +0000 (15:35 +0000)
12 files changed:
ChangeLog
ChangeLog.claws
ChangeLog.jp
NEWS
configure.in
src/compose.c
src/compose.h
src/news.c
src/news.h
src/procmsg.c
src/procmsg.h
src/send.c

index a31a6c7..f2a1ef7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,49 @@
+2002-10-04
+
+       * configure.in: added $LDAP_LIBS for lber library detection.
+
+2002-10-03
+
+       * version 0.8.5
+
+2002-10-03
+
+       * src/procmsg.c: procmsg_msginfo_get_full_info(): fixed a memory
+         leak, and added error checking.
+
+2002-10-03
+
+       * src/compose.[ch]: added a flag Compose::use_newsgroups, and
+         removed Compose::orig_account.
+         compose_check_for_valid_recipient(): check only enabled entries.
+         compose_write_headers()
+         compose_redirect_write_headers(): add Newsgroups header only
+         when the entry is enabled.
+         compose_send(): modified the method of finding a mail account
+         from a news account so that it tries to match the From address.
+       * src/send.c: send_message_queue(): enabled the queueing of news
+         messages.
+       * src/news.[ch]: news_post_stream(): new.
+
+2002-10-03
+
+       * configure.in: check lber first and use $LDAP_LIBS on the check
+         for ldap.
+
+2002-10-02
+
+       * po/*.po: fixed many typos of format strings which will lead to
+         crash (thanks to Sergey Vlasov).
+
+2002-10-02
+
+       * src/procheader.c: procheader_parse_stream(): added Cc header
+         to the target for full parsing.
+       * src/procmsg.[ch]: procmsg_msginfo_get_full_info(): new. It
+         returns the full message information from the given information.
+       * src/compose.c: compose_reply(), compose_forward(): get full
+         message information for Cc header.
+
 2002-10-02
 
        * src/inc.c: inc_account_mail(), inc_all_account_mail(): update
index c802d8e..05f0f85 100644 (file)
@@ -1,3 +1,8 @@
+2002-10-04 [paul]      0.8.3claws46
+
+       * sync with 0.8.5
+               see ChangeLog 2002-10-02 and 2002-10-03
+
 2002-10-04 [christoph] 0.8.3claws45
 
        * src/inc.c
index 2ab6779..8968b2d 100644 (file)
@@ -1,3 +1,49 @@
+2002-10-04
+
+       * configure.in: lber ¥é¥¤¥Ö¥é¥ê¤Î¸¡½Ð¤Ë $LDAP_LIBS ¤òÄɲá£
+
+2002-10-03
+
+       * version 0.8.5
+
+2002-10-03
+
+       * src/procmsg.c: procmsg_msginfo_get_full_info(): ¥á¥â¥ê¥ê¡¼¥¯¤ò
+         ½¤Àµ¤·¡¢¥¨¥é¡¼¥Á¥§¥Ã¥¯¤òÄɲá£
+
+2002-10-03
+
+       * src/compose.[ch]: ¥Õ¥é¥° Compose::use_newsgroups ¤òÄɲä·¡¢
+         Compose::orig_account ¤òºï½ü¡£
+         compose_check_for_valid_recipient(): Í­¸ú¤Ê¥¨¥ó¥È¥ê¤Î¤ß¤ò¥Á¥§¥Ã¥¯¡£
+         compose_write_headers()
+         compose_redirect_write_headers(): ¥¨¥ó¥È¥ê¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç
+         ¤Î¤ß Newsgroups ¥Ø¥Ã¥À¤òÄɲá£
+         compose_send(): ¥Ë¥å¡¼¥¹¥¢¥«¥¦¥ó¥È¤«¤é¥á¡¼¥ë¥¢¥«¥¦¥ó¥È¤ò¸«¤Ä¤±¤ë
+         ÊýË¡¤ò From ¥¢¥É¥ì¥¹¤ò¥Þ¥Ã¥Á¤µ¤»¤ë¤è¤¦¤ËÊѹ¹¡£
+       * src/send.c: send_message_queue(): ¥Ë¥å¡¼¥¹¥á¥Ã¥»¡¼¥¸¤ÎÁ÷¿®ÂÔµ¡
+         ¤òÍ­¸ú¤Ë¤·¤¿¡£
+       * src/news.[ch]: news_post_stream(): ¿·µ¬¡£
+
+2002-10-03
+
+       * configure.in: lber ¤òÀè¤Ë¥Á¥§¥Ã¥¯¤·¡¢ ldap ¤Î¥Á¥§¥Ã¥¯»þ¤Ë
+         $LDAP_LIBS ¤ò»ÈÍÑ¡£
+
+2002-10-02
+
+       * po/*.po: ¥¯¥é¥Ã¥·¥å¤ò°ú¤­µ¯¤³¤¹Â¿¤¯¤Î¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»úÎó¤Î¥ß¥¹
+         ¤ò½¤Àµ(Sergey Vlasov ¤µ¤ó thanks)¡£
+
+2002-10-02
+
+       * src/procheader.c: procheader_parse_stream(): ´°Á´¥Ñ¡¼¥¹¤ÎÂоÝ
+         ¤Ë Cc ¥Ø¥Ã¥À¤òÄɲá£
+       * src/procmsg.[ch]: procmsg_msginfo_get_full_info(): ¿·µ¬¡£»ØÄê
+         ¤µ¤ì¤¿¾ðÊ󤫤鴰Á´¤Ê¥á¥Ã¥»¡¼¥¸¾ðÊó¤òÊÖ¤¹¡£
+       * src/compose.c: compose_reply(), compose_forward(): Cc ¥Ø¥Ã¥À¤Î
+         ¤¿¤á¤Ë´°Á´¤Ê¥á¥Ã¥»¡¼¥¸¾ðÊó¤òÆÀ¤ë¤è¤¦¤Ë¤·¤¿¡£
+
 2002-10-02
 
        * src/inc.c: inc_account_mail(), inc_all_account_mail(): IMAP4 ¤È
diff --git a/NEWS b/NEWS
index c36b915..56f0701 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,15 @@
 Changes of Sylpheed
 
+* 0.8.5
+
+    * Many fatal errors which will lead to crash in message catalogs have
+      been fixed.
+    * Cc header is now correctly recognized on reply and forwarding.
+    * A problem of refresh of summary on IMAP4 and News folder has been fixed.
+    * A bug of changing accounts on composition window has been fixed.
+    * The LDAP library detection of configure script has been fixed again.
+    * Queueing of news messages has been enabled.
+
 * 0.8.4
 
     * The 'Select thread' function is added.
index d997e6a..a53987c 100644 (file)
@@ -10,7 +10,7 @@ MINOR_VERSION=8
 MICRO_VERSION=3
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws45
+EXTRA_VERSION=claws46
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index fe3dcec..25fbf42 100644 (file)
@@ -889,16 +889,11 @@ static void compose_generic_reply(MsgInfo *msginfo, gboolean quote,
                reply_account = account;
 
        compose = compose_create(account, COMPOSE_REPLY);
-       compose->replyinfo = procmsg_msginfo_new_ref(msginfo);
 
-#if 0 /* NEW COMPOSE GUI */
-       if (followup_and_reply_to) {
-               gtk_widget_show(compose->to_hbox);
-               gtk_widget_show(compose->to_entry);
-               gtk_table_set_row_spacing(GTK_TABLE(compose->table), 1, 4);
-               compose->use_to = TRUE;
-       }
-#endif
+       compose->replyinfo = procmsg_msginfo_get_full_info(msginfo);
+       if (!compose->replyinfo)
+               compose->replyinfo = procmsg_msginfo_copy(msginfo);
+
        if (msginfo->folder && msginfo->folder->ret_rcpt) {
                GtkItemFactory *ifactory;
        
@@ -933,7 +928,7 @@ static void compose_generic_reply(MsgInfo *msginfo, gboolean quote,
                else
                        qmark = "> ";
 
-               quote_str = compose_quote_fmt(compose, msginfo,
+               quote_str = compose_quote_fmt(compose, compose->replyinfo,
                                              prefs_common.quotefmt,
                                              qmark, body);
        }
@@ -1030,6 +1025,11 @@ Compose *compose_forward(PrefsAccount *account, MsgInfo *msginfo,
                } else {
                        gchar *qmark;
                        gchar *quote_str;
+                       MsgInfo *full_msginfo;
+
+                       full_msginfo = procmsg_msginfo_get_full_info(msginfo);
+                       if (!full_msginfo)
+                               full_msginfo = procmsg_msginfo_copy(msginfo);
 
                        if (prefs_common.fw_quotemark &&
                            *prefs_common.fw_quotemark)
@@ -1041,6 +1041,8 @@ Compose *compose_forward(PrefsAccount *account, MsgInfo *msginfo,
                                                      prefs_common.fw_quotefmt,
                                                      qmark, body);
                        compose_attach_parts(compose, msginfo);
+
+                       procmsg_msginfo_free(full_msginfo);
                }
 
        if (prefs_common.auto_sig)
@@ -2672,6 +2674,7 @@ static void compose_select_account(Compose *compose, PrefsAccount *account)
                gtk_widget_show(compose->newsgroups_hbox);
                gtk_widget_show(compose->newsgroups_entry);
                gtk_table_set_row_spacing(GTK_TABLE(compose->table), 2, 4);
+               compose->use_newsgroups = TRUE;
 
                menuitem = gtk_item_factory_get_item(ifactory, "/View/To");
                gtk_check_menu_item_set_active
@@ -2688,6 +2691,7 @@ static void compose_select_account(Compose *compose, PrefsAccount *account)
                gtk_widget_hide(compose->newsgroups_entry);
                gtk_table_set_row_spacing(GTK_TABLE(compose->table), 2, 0);
                gtk_widget_queue_resize(compose->table_vbox);
+               compose->use_newsgroups = FALSE;
 
                menuitem = gtk_item_factory_get_item(ifactory, "/View/To");
                gtk_check_menu_item_set_active
@@ -2847,7 +2851,6 @@ gint compose_send(Compose *compose)
        if (lock) return 1;
 
        g_return_val_if_fail(compose->account != NULL, -1);
-       g_return_val_if_fail(compose->orig_account != NULL, -1);
 
        lock = TRUE;
 
@@ -2881,13 +2884,17 @@ gint compose_send(Compose *compose)
 #if 0 /* NEW COMPOSE GUI */
                if (compose->account->protocol != A_NNTP)
                        ac = compose->account;
-               else if (compose->orig_account->protocol != A_NNTP)
-                       ac = compose->orig_account;
-               else if (cur_account && cur_account->protocol != A_NNTP)
-                       ac = cur_account;
                else {
-                       ac = compose_current_mail_account();
+                       ac = account_find_from_address(compose->account->address);
                        if (!ac) {
+                               if (cur_account && cur_account->protocol != A_NNTP)
+                                       ac = cur_account;
+                               else
+                                       ac = account_get_default();
+                       }
+                       if (!ac || ac->protocol == A_NNTP) {
+                               alertpanel_error(_("Account for sending mail is not specified.\n"
+                                                  "Please select a mail account before sending."));
                                unlink(tmp);
                                lock = FALSE;
                                return -1;
@@ -2901,14 +2908,7 @@ gint compose_send(Compose *compose)
        }
 
        if (ok == 0 && compose->newsgroup_list) {
-               Folder *folder;
-
-               if (compose->account->protocol == A_NNTP)
-                       folder = FOLDER(compose->account->folder);
-               else
-                       folder = FOLDER(compose->orig_account->folder);
-
-               ok = news_post(folder, tmp);
+               ok = news_post(FOLDER(compose->account->folder), tmp);
                if (ok < 0) {
                        alertpanel_error(_("Error occurred while posting the message to %s ."),
                                         compose->account->nntp_server);
@@ -3516,7 +3516,6 @@ static gint compose_queue_sub(Compose *compose, gint *msgnum, FolderItem **item,
        
        debug_print("queueing message...\n");
        g_return_val_if_fail(compose->account != NULL, -1);
-        g_return_val_if_fail(compose->orig_account != NULL, -1);
 
         lock = TRUE;
        
@@ -3534,8 +3533,6 @@ static gint compose_queue_sub(Compose *compose, gint *msgnum, FolderItem **item,
        if (compose->to_list) {
                if (compose->account->protocol != A_NNTP)
                        mailac = compose->account;
-               else if (compose->orig_account->protocol != A_NNTP)
-                       mailac = compose->orig_account;
                else if (cur_account && cur_account->protocol != A_NNTP)
                        mailac = cur_account;
                else if (!(mailac = compose_current_mail_account())) {
@@ -3548,7 +3545,7 @@ static gint compose_queue_sub(Compose *compose, gint *msgnum, FolderItem **item,
        if (compose->newsgroup_list) {
                 if (compose->account->protocol == A_NNTP)
                         newsac = compose->account;
-                else if (!(newsac = compose->orig_account) || (newsac->protocol != A_NNTP)) {
+                else if (!newsac->protocol != A_NNTP) {
                        lock = FALSE;
                        alertpanel_error(_("No account for posting news available!"));
                        return -1;
@@ -3624,12 +3621,13 @@ static gint compose_queue_sub(Compose *compose, gint *msgnum, FolderItem **item,
                fprintf(fp, "NSV:\n");
        fprintf(fp, "SSH:\n");
        /* write recepient list */
-       fprintf(fp, "R:");
        if (compose->to_list) {
-               fprintf(fp, "<%s>", (gchar *)compose->to_list->data);
-               for (cur = compose->to_list->next; cur != NULL; cur = cur->next)
+               fprintf(fp, "R:<%s>", (gchar *)compose->to_list->data);
+               for (cur = compose->to_list->next; cur != NULL;
+                    cur = cur->next)
                        fprintf(fp, ",<%s>", (gchar *)cur->data);
-       }
+               fprintf(fp, "\n");
+       } else
        fprintf(fp, "\n");
        /* write newsgroup list */
        fprintf(fp, "NG:");
@@ -3946,18 +3944,20 @@ static gint compose_write_headers(Compose *compose, FILE *fp,
        /* Newsgroups */
        compose_write_headers_from_headerlist(compose, fp, "Newsgroups");
 #if 0 /* NEW COMPOSE GUI */
-       str = gtk_entry_get_text(GTK_ENTRY(compose->newsgroups_entry));
-       if (*str != '\0') {
-               Xstrdup_a(str, str, return -1);
-               g_strstrip(str);
-               remove_space(str);
+       if (compose->use_newsgroups) {
+               str = gtk_entry_get_text(GTK_ENTRY(compose->newsgroups_entry));
                if (*str != '\0') {
-                       compose->newsgroup_list =
-                               newsgroup_list_append(compose->newsgroup_list,
-                                                     str);
-                       compose_convert_header(buf, sizeof(buf), str,
-                                              strlen("Newsgroups: "));
-                       fprintf(fp, "Newsgroups: %s\n", buf);
+                       Xstrdup_a(str, str, return -1);
+                       g_strstrip(str);
+                       remove_space(str);
+                       if (*str != '\0') {
+                               compose->newsgroup_list =
+                                       newsgroup_list_append
+                                               (compose->newsgroup_list, str);
+                               compose_convert_header(buf, sizeof(buf), str,
+                                                      strlen("Newsgroups: "));
+                               fprintf(fp, "Newsgroups: %s\n", buf);
+                       }
                }
        }
 #endif
@@ -4634,7 +4634,6 @@ static Compose *compose_create(PrefsAccount *account, ComposeMode mode)
        titles[COL_NAME]     = _("Name");
 
        compose->account = account;
-       compose->orig_account = account;
 
        window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
        gtk_window_set_policy(GTK_WINDOW(window), TRUE, TRUE, FALSE);
index b76c66a..b1c2898 100644 (file)
@@ -162,6 +162,7 @@ struct _Compose
        gboolean use_cc;
        gboolean use_bcc;
        gboolean use_replyto;
+       gboolean use_newsgroups;
        gboolean use_followupto;
        gboolean use_attach;
 
@@ -180,7 +181,6 @@ struct _Compose
        GSList *newsgroup_list;
 
        PrefsAccount *account;
-       PrefsAccount *orig_account;
 
        UndoMain *undostruct;
 
index e50ef17..9876a67 100644 (file)
@@ -585,7 +585,6 @@ void news_remove_group_list_cache(Folder *folder)
 
 gint news_post(Folder *folder, const gchar *file)
 {
-       NNTPSession *session;
        FILE *fp;
        gint ok;
 
@@ -593,24 +592,38 @@ gint news_post(Folder *folder, const gchar *file)
        g_return_val_if_fail(folder->type == F_NEWS, -1);
        g_return_val_if_fail(file != NULL, -1);
 
-       session = news_session_get(folder);
-       if (!session) return -1;
-
        if ((fp = fopen(file, "rb")) == NULL) {
                FILE_OP_ERROR(file, "fopen");
                return -1;
        }
 
+       ok = news_post_stream(folder, fp);
+
+       fclose(fp);
+
+       statusbar_pop_all();
+
+       return ok;
+}
+
+gint news_post_stream(Folder *folder, FILE *fp)
+{
+       NNTPSession *session;
+       gint ok;
+
+       g_return_val_if_fail(folder != NULL, -1);
+       g_return_val_if_fail(folder->type == F_NEWS, -1);
+       g_return_val_if_fail(fp != NULL, -1);
+
+       session = news_session_get(folder);
+       if (!session) return -1;
+
        ok = nntp_post(session->nntp_sock, fp);
        if (ok != NN_SUCCESS) {
                log_warning(_("can't post article.\n"));
                return -1;
        }
 
-       fclose(fp);
-
-       statusbar_pop_all();
-
        return 0;
 }
 
index fec7348..9474b83 100644 (file)
@@ -21,6 +21,7 @@
 #define __NEWS_H__
 
 #include <glib.h>
+#include <stdio.h>
 
 #include "folder.h"
 #include "session.h"
index 17cd426..8e0fad8 100644 (file)
@@ -1085,6 +1085,37 @@ MsgInfo *procmsg_msginfo_copy(MsgInfo *msginfo)
        return newmsginfo;
 }
 
+MsgInfo *procmsg_msginfo_get_full_info(MsgInfo *msginfo)
+{
+       MsgInfo *full_msginfo;
+       gchar *file;
+
+       if (msginfo == NULL) return NULL;
+
+       file = procmsg_get_message_file(msginfo);
+       if (!file) {
+               g_warning("procmsg_msginfo_get_full_info(): can't get message file.\n");
+               return NULL;
+       }
+
+       full_msginfo = procheader_parse_file(file, msginfo->flags, TRUE, FALSE);
+       g_free(file);
+       if (!full_msginfo) return NULL;
+
+       full_msginfo->msgnum = msginfo->msgnum;
+       full_msginfo->size = msginfo->size;
+       full_msginfo->mtime = msginfo->mtime;
+       full_msginfo->folder = msginfo->folder;
+       full_msginfo->to_folder = msginfo->to_folder;
+#if USE_GPGME
+       full_msginfo->plaintext_file = g_strdup(msginfo->plaintext_file);
+       full_msginfo->decryption_failed = msginfo->decryption_failed;
+#endif
+
+       /* return full_msginfo;*/
+       return procmsg_msginfo_new_ref(msginfo);
+}
+
 void procmsg_msginfo_free(MsgInfo *msginfo)
 {
        if (msginfo == NULL) return;
index da94523..cfbff25 100644 (file)
@@ -265,6 +265,7 @@ void        procmsg_print_message           (MsgInfo        *msginfo,
 MsgInfo *procmsg_msginfo_new           ();
 MsgInfo *procmsg_msginfo_new_ref       (MsgInfo        *msginfo);
 MsgInfo *procmsg_msginfo_copy          (MsgInfo        *msginfo);
+MsgInfo *procmsg_msginfo_get_full_info (MsgInfo        *msginfo);
 void    procmsg_msginfo_free           (MsgInfo        *msginfo);
 guint   procmsg_msginfo_memusage       (MsgInfo        *msginfo);
 
index 5a8de4b..0772ded 100644 (file)
@@ -121,13 +121,14 @@ gint send_message_queue(const gchar *file)
                                       {"AID:", NULL, FALSE},
                                       {NULL,   NULL, FALSE}};
        FILE *fp;
-       gint val;
+       gint val = 0;
        gchar *from = NULL;
        gchar *server = NULL;
        GSList *to_list = NULL;
        gchar buf[BUFFSIZE];
        gint hnum;
-       PrefsAccount *ac = NULL;
+       glong fpos;
+       PrefsAccount *ac = NULL, *mailac = NULL, *newsac = NULL;
 
        g_return_val_if_fail(file != NULL, -1);
 
@@ -158,36 +159,59 @@ gint send_message_queue(const gchar *file)
                }
        }
 
-       if (!to_list || !from) {
+       if (((!ac || (ac && ac->protocol != A_NNTP)) && !to_list) || !from) {
                g_warning(_("Queued message header is broken.\n"));
                val = -1;
-       } else if (ac && ac->use_mail_command && ac->mail_command &&
-                  (*ac->mail_command)) {
-               val = send_message_local(ac->mail_command, fp);
        } else if (prefs_common.use_extsend && prefs_common.extsend_cmd) {
                val = send_message_local(prefs_common.extsend_cmd, fp);
        } else {
-               if (!ac) {
+               if (ac && ac->protocol == A_NNTP) {
+                       newsac = ac;
+
+                       /* search mail account */
+                       mailac = account_find_from_address(from);
+                       if (!mailac) {
+                               if (cur_account &&
+                                   cur_account->protocol != A_NNTP)
+                                       mailac = cur_account;
+                               else {
+                                       mailac = account_get_default();
+                                       if (mailac->protocol == A_NNTP)
+                                               mailac = NULL;
+                               }
+                       }
+               } else if (ac) {
+                       mailac = ac;
+               } else {
                        ac = account_find_from_smtp_server(from, server);
                        if (!ac) {
                                g_warning(_("Account not found. "
                                            "Using current account...\n"));
                                ac = cur_account;
+                               if (ac && ac->protocol != A_NNTP)
+                                       mailac = ac;
                        }
                }
 
-               if (ac)
-                       val = send_message_smtp(ac, to_list, fp);
-               else {
-                       PrefsAccount tmp_ac;
+               fpos = ftell(fp);
+               if (to_list) {
+                       if (mailac)
+                               val = send_message_smtp(mailac, to_list, fp);
+                       else {
+                               PrefsAccount tmp_ac;
 
-                       g_warning(_("Account not found.\n"));
+                               g_warning(_("Account not found.\n"));
 
-                       memset(&tmp_ac, 0, sizeof(PrefsAccount));
-                       tmp_ac.address = from;
-                       tmp_ac.smtp_server = server;
-                       tmp_ac.smtpport = SMTP_PORT;
-                       val = send_message_smtp(&tmp_ac, to_list, fp);
+                               memset(&tmp_ac, 0, sizeof(PrefsAccount));
+                               tmp_ac.address = from;
+                               tmp_ac.smtp_server = server;
+                               tmp_ac.smtpport = SMTP_PORT;
+                               val = send_message_smtp(&tmp_ac, to_list, fp);
+                       }
+               }
+               if (val == 0 && newsac) {
+                       fseek(fp, fpos, SEEK_SET);
+                       val = news_post_stream(FOLDER(newsac->folder), fp);
                }
        }