more sync with 0.7.5cvs7
authorPaul Mangan <paul@claws-mail.org>
Thu, 2 May 2002 06:42:48 +0000 (06:42 +0000)
committerPaul Mangan <paul@claws-mail.org>
Thu, 2 May 2002 06:42:48 +0000 (06:42 +0000)
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.in
src/compose.c

index 13f5c0902eb7eab7d3c6504ac1819e8a3ce59461..ded31eedfea821c243447942b08d348ee7442a79 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2002-05-02
+
+       * src/compose.c: compose_write_headers(): quote self address name
+         if required. Some code cleanups. Don't override Newsgroups and
+         Cc with custom headers.
+       * src/imap.c: imap_add_msg(): return UID for appended message.
+       * src/compose.c: compose_queue(): check if queue folder exists.
+       * src/imap.c: QUOTE_IF_REQUIRED(): quote also other IMAP special
+         characters.
+
 2002-04-25
 
        * src/utils.[ch]: trim_string(): new. It trim characters longer than
 2002-04-25
 
        * src/utils.[ch]: trim_string(): new. It trim characters longer than
index beaad1520ebccf6b8a9c8384d3adca4a2d82ba8d..bc444fdb9bdfaa9d32881f31e45b00ddfedbe6cc 100644 (file)
@@ -1,3 +1,9 @@
+2002-05-02 [paul]      0.7.5claws5
+
+       * src/compose.c
+               more sync with 0.7.5cvs7, see ChangeLog entry
+               2002-05-02
+
 2002-05-02 [hiro]      0.7.5claws4
 
        * src/compose.c
 2002-05-02 [hiro]      0.7.5claws4
 
        * src/compose.c
index b7d6a50064e790f227831271cff4450ed5656d59..950b78661023afd7fa3e12012ff6376acc9fa847 100644 (file)
@@ -1,3 +1,14 @@
+2002-05-02
+
+       * src/compose.c: compose_write_headers(): É¬ÍפǤ¢¤ì¤Ð¼«Ê¬¤Î¥¢¥É¥ì¥¹
+         ¤ò°úÍÑÉä¤Ç°Ï¤à¤è¤¦¤Ë¤·¤¿¡£¥³¡¼¥É¤ÎÀ°Íý¡£ Newsgroups ¤È Cc ¤ò
+         ¥«¥¹¥¿¥à¥Ø¥Ã¥À¤Ç¾å½ñ¤­¤·¤Ê¤¤¤è¤¦¤Ë¤·¤¿¡£
+       * src/imap.c: imap_add_msg(): Äɲä·¤¿¥á¥Ã¥»¡¼¥¸¤Î UID ¤òÊÖ¤¹¤è¤¦¤Ë
+         ¤·¤¿¡£
+       * src/compose.c: compose_queue(): queue ¥Õ¥©¥ë¥À¤Î¸ºß¤ò¥Á¥§¥Ã¥¯¡£
+       * src/imap.c: QUOTE_IF_REQUIRED(): ¤½¤Î¾¤Î IMAP ¥¹¥Ú¥·¥ã¥ë¥­¥ã¥é¥¯¥¿
+         ¤â°úÍÑÉä¤Ç°Ï¤à¤è¤¦¤Ë¤·¤¿¡£
+
 2002-04-25
 
        * src/utils.[ch]: trim_string(): ¿·µ¬¡£»ØÄꤷ¤¿Ä¹¤µ¤è¤êŤ¤Ê¸»ú¤ò
 2002-04-25
 
        * src/utils.[ch]: trim_string(): ¿·µ¬¡£»ØÄꤷ¤¿Ä¹¤µ¤è¤êŤ¤Ê¸»ú¤ò
index c4804969c3d4d8f14d926ff7c0bb9f292a824c9e..8a63cf66c3a9a9db13376fa30db287ad70ecbd3a 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=7
 MICRO_VERSION=5
 INTERFACE_AGE=0
 BINARY_AGE=0
 MICRO_VERSION=5
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws4
+EXTRA_VERSION=claws5
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 4d239cd382ada011333aa373133ed58609bd3da9..91a3e6973f3e467280bf368158fd9cc4b209262b 100644 (file)
@@ -3509,6 +3509,36 @@ static void compose_write_attach(Compose *compose, FILE *fp)
        fprintf(fp, "\n--%s--\n", compose->boundary);
 }
 
        fprintf(fp, "\n--%s--\n", compose->boundary);
 }
 
+#define QUOTE_IF_REQUIRED(out, str)                    \
+{                                                      \
+       if (*str != '"' && strchr(str, ',')) {          \
+               gchar *__tmp;                           \
+               gint len;                               \
+                                                       \
+               len = strlen(str) + 3;                  \
+               Xalloca(__tmp, len, return -1);         \
+               g_snprintf(__tmp, len, "\"%s\"", str);  \
+               out = __tmp;                            \
+       } else {                                        \
+               Xstrdup_a(out, str, return -1);         \
+       }                                               \
+}
+
+#define PUT_RECIPIENT_HEADER(header, str)                                   \
+{                                                                           \
+       if (*str != '\0') {                                                  \
+               Xstrdup_a(str, str, return -1);                              \
+               g_strstrip(str);                                             \
+               if (*str != '\0') {                                          \
+                       compose->to_list = address_list_append               \
+                               (compose->to_list, str);                     \
+                       compose_convert_header                               \
+                               (buf, sizeof(buf), str, strlen(header) + 2); \
+                       fprintf(fp, "%s: %s\n", header, buf);                \
+               }                                                            \
+       }                                                                    \
+}
+
 #define IS_IN_CUSTOM_HEADER(header) \
        (compose->account->add_customhdr && \
         custom_header_find(compose->account->customhdr_list, header) != NULL)
 #define IS_IN_CUSTOM_HEADER(header) \
        (compose->account->add_customhdr && \
         custom_header_find(compose->account->customhdr_list, header) != NULL)
@@ -3571,6 +3601,7 @@ static gint compose_write_headers(Compose *compose, FILE *fp,
 {
        gchar buf[BUFFSIZE];
        gchar *str;
 {
        gchar buf[BUFFSIZE];
        gchar *str;
+       gchar *name;
        /* struct utsname utsbuf; */
 
        g_return_val_if_fail(fp != NULL, -1);
        /* struct utsname utsbuf; */
 
        g_return_val_if_fail(fp != NULL, -1);
@@ -3590,8 +3621,9 @@ static gint compose_write_headers(Compose *compose, FILE *fp,
                        compose_convert_header
                                (buf, sizeof(buf), compose->account->name,
                                 strlen("From: "));
                        compose_convert_header
                                (buf, sizeof(buf), compose->account->name,
                                 strlen("From: "));
+                       QUOTE_IF_REQUIRED(name, buf);
                        fprintf(fp, "From: %s <%s>\n",
                        fprintf(fp, "From: %s <%s>\n",
-                               buf, compose->account->address);
+                               name, compose->account->address);
                } else
                        fprintf(fp, "From: %s\n", compose->account->address);
        }
                } else
                        fprintf(fp, "From: %s\n", compose->account->address);
        }
@@ -3601,20 +3633,7 @@ static gint compose_write_headers(Compose *compose, FILE *fp,
 #if 0 /* NEW COMPOSE GUI */
        if (compose->use_to) {
                str = gtk_entry_get_text(GTK_ENTRY(compose->to_entry));
 #if 0 /* NEW COMPOSE GUI */
        if (compose->use_to) {
                str = gtk_entry_get_text(GTK_ENTRY(compose->to_entry));
-               if (*str != '\0') {
-                       Xstrdup_a(str, str, return -1);
-                       g_strstrip(str);
-                       if (*str != '\0') {
-                               compose->to_list = address_list_append
-                                       (compose->to_list, str);
-                               if (!IS_IN_CUSTOM_HEADER("To")) {
-                                       compose_convert_header
-                                               (buf, sizeof(buf), str,
-                                                strlen("To: "));
-                                       fprintf(fp, "To: %s\n", buf);
-                               }
-                       }
-               }
+               PUT_RECIPIENT_HEADER("To", str);
        }
 #endif
 
        }
 #endif
 
@@ -3630,11 +3649,9 @@ static gint compose_write_headers(Compose *compose, FILE *fp,
                        compose->newsgroup_list =
                                newsgroup_list_append(compose->newsgroup_list,
                                                      str);
                        compose->newsgroup_list =
                                newsgroup_list_append(compose->newsgroup_list,
                                                      str);
-                       if (!IS_IN_CUSTOM_HEADER("Newsgroups")) {
-                               compose_convert_header(buf, sizeof(buf), str,
-                                                      strlen("Newsgroups: "));
-                               fprintf(fp, "Newsgroups: %s\n", buf);
-                       }
+                       compose_convert_header(buf, sizeof(buf), str,
+                                              strlen("Newsgroups: "));
+                       fprintf(fp, "Newsgroups: %s\n", buf);
                }
        }
 #endif
                }
        }
 #endif
@@ -3643,20 +3660,7 @@ static gint compose_write_headers(Compose *compose, FILE *fp,
 #if 0 /* NEW COMPOSE GUI */
        if (compose->use_cc) {
                str = gtk_entry_get_text(GTK_ENTRY(compose->cc_entry));
 #if 0 /* NEW COMPOSE GUI */
        if (compose->use_cc) {
                str = gtk_entry_get_text(GTK_ENTRY(compose->cc_entry));
-               if (*str != '\0') {
-                       Xstrdup_a(str, str, return -1);
-                       g_strstrip(str);
-                       if (*str != '\0') {
-                               compose->to_list = address_list_append
-                                       (compose->to_list, str);
-                               if (!IS_IN_CUSTOM_HEADER("Cc")) {
-                                       compose_convert_header
-                                               (buf, sizeof(buf), str,
-                                                strlen("Cc: "));
-                                       fprintf(fp, "Cc: %s\n", buf);
-                               }
-                       }
-               }
+               PUT_RECIPIENT_HEADER("Cc", str);
        }
 #endif
        /* Bcc */
        }
 #endif
        /* Bcc */
@@ -3664,17 +3668,7 @@ static gint compose_write_headers(Compose *compose, FILE *fp,
 #if 0 /* NEW COMPOSE GUI */
        if (compose->use_bcc) {
                str = gtk_entry_get_text(GTK_ENTRY(compose->bcc_entry));
 #if 0 /* NEW COMPOSE GUI */
        if (compose->use_bcc) {
                str = gtk_entry_get_text(GTK_ENTRY(compose->bcc_entry));
-               if (*str != '\0') {
-                       Xstrdup_a(str, str, return -1);
-                       g_strstrip(str);
-                       if (*str != '\0') {
-                               compose->to_list = address_list_append
-                                       (compose->to_list, str);
-                               compose_convert_header(buf, sizeof(buf), str,
-                                                      strlen("Bcc: "));
-                               fprintf(fp, "Bcc: %s\n", buf);
-                       }
-               }
+               PUT_RECIPIENT_HEADER("Bcc", str);
        }
 #endif
 
        }
 #endif