sync with 0.7.4cvs21
authorPaul Mangan <paul@claws-mail.org>
Wed, 27 Mar 2002 09:38:08 +0000 (09:38 +0000)
committerPaul Mangan <paul@claws-mail.org>
Wed, 27 Mar 2002 09:38:08 +0000 (09:38 +0000)
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.in
src/compose.c
src/imap.c

index 11d4570..86c53bc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2002-03-27
+
+       * src/compose.c: show confirmation dialog before sending if Subject
+         is empty.
+         compose_check_entries(): new.
+         compose_send()
+         compose_send_later_cb(): use compose_check_entries().
+       * src/imap.c: imap_parse_atom(): more fix for parsing responses.
+
+2002-03-26
+
+       * src/imap.c: imap_parse_atom(): fixed a bug that didn't parse the
+         responses with continuous line correctly, and fixed a memory leak.
+
 2002-03-26
 
        * src/undo.c: undo_insert_text_cb(): fixed a crash bug if the text
index 2a4a8cd..54cfeeb 100644 (file)
@@ -1,3 +1,8 @@
+2002-03-27 [paul]      0.7.4claws48
+
+       * sync with 0.7.4cvs21
+               see ChangeLog 2002-03-26 and 2002-03-27
+
 2002-03-26 [hoa]       0.7.4claws47
 
        * src/prefs_folder_item.c
index ea8c4f4..71842e7 100644 (file)
@@ -1,3 +1,16 @@
+2002-03-27
+
+       * src/compose.c: Subject ¤¬¶õ¤Î¤È¤­¤ÏÁ÷¿®Á°¤Ë³Îǧ¥À¥¤¥¢¥í¥°¤òɽ¼¨¡£
+         compose_check_entries(): ¿·µ¬¡£
+         compose_send()
+         compose_send_later_cb(): compose_check_entries() ¤ò»ÈÍÑ¡£
+       * src/imap.c: imap_parse_atom(): ±þÅú²òÀϤò¤µ¤é¤Ë½¤Àµ¡£
+
+2002-03-26
+
+       * src/imap.c: imap_parse_atom(): ·Ñ³¹Ô±þÅú¤òÀµ¤·¤¯¥Ñ¡¼¥¹¤·¤Æ¤¤¤Ê
+         ¤«¤Ã¤¿¥Ð¥°¤È¥á¥â¥ê¥ê¡¼¥¯¤ò½¤Àµ¡£
+
 2002-03-26
 
        * src/undo.c: undo_insert_text_cb(): ¥Æ¥­¥¹¥È¤ÎŤµ¤¬Â礭¤¤¤È¤­¤Ë
index a5df16e..22cd7ab 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=7
 MICRO_VERSION=4
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws47
+EXTRA_VERSION=claws48
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 65a2108..7d29e8d 100644 (file)
@@ -198,6 +198,9 @@ static void compose_set_title                       (Compose        *compose);
 
 static PrefsAccount *compose_current_mail_account(void);
 /* static gint compose_send                    (Compose        *compose); */
+static gboolean compose_check_for_valid_recipient
+                                               (Compose        *compose);
+static gboolean compose_check_entries          (Compose        *compose);
 static gint compose_write_to_file              (Compose        *compose,
                                                 const gchar    *file,
                                                 gboolean        is_draft);
@@ -2570,6 +2573,29 @@ gboolean compose_check_for_valid_recipient(Compose *compose) {
        return recipient_found;
 }
 
+static gboolean compose_check_entries(Compose *compose)
+{
+       gchar *str;
+
+       if (compose_check_for_valid_recipient(compose) == FALSE) {
+               alertpanel_error(_("Recipient is not specified."));
+               return FALSE;
+       }
+
+       str = gtk_entry_get_text(GTK_ENTRY(compose->subject_entry));
+       if (*str == '\0') {
+               AlertValue aval;
+
+               aval = alertpanel(_("Send"),
+                                 _("Subject is empty. Send it anyway?"),
+                                 _("Yes"), _("No"), NULL);
+               if (aval != G_ALERTDEFAULT)
+                       return FALSE;
+       }
+
+       return TRUE;
+}
+
 gint compose_send(Compose *compose)
 {
        gint msgnum;
@@ -2604,8 +2630,7 @@ gint compose_send(Compose *compose)
 
        lock = TRUE;
 
-       if(!compose_check_for_valid_recipient(compose)) {
-               alertpanel_error(_("Recipient is not specified."));
+       if (compose_check_entries(compose) == FALSE) {
                lock = FALSE;
                return 1;
        }
@@ -3144,12 +3169,17 @@ static gint compose_queue(Compose *compose, gint *msgnum, FolderItem **item)
 
         lock = TRUE;
        
-        if(!compose_check_for_valid_recipient(compose)) {
+/*        if(!compose_check_for_valid_recipient(compose)) {
                 alertpanel_error(_("Recipient is not specified."));
                 lock = FALSE;
                 return -1;
-        }
+        } */
                                                                        
+       if (compose_check_entries(compose) == FALSE) {
+                lock = FALSE;
+                return -1;
+       }
+
        if (!compose->to_list && !compose->newsgroup_list) {
                g_warning(_("can't get recipient list."));
                lock = FALSE;
index a684338..4884a5d 100644 (file)
@@ -1737,10 +1737,23 @@ static gchar *imap_parse_atom(SockInfo *sock, gchar *src,
                              gchar *dest, gint dest_len, GString *str)
 {
        gchar *cur_pos = src;
+       gchar *nextline;
 
        g_return_val_if_fail(str != NULL, cur_pos);
 
-       while (*cur_pos == ' ') cur_pos++;
+       /* read the next line if the current response buffer is empty */
+       while (isspace(*cur_pos)) cur_pos++;
+       while (*cur_pos == '\0') {
+               if ((nextline = sock_getline(sock)) == NULL)
+                       return cur_pos;
+               g_string_assign(str, nextline);
+               cur_pos = str->str;
+               strretchomp(nextline);
+               log_print("IMAP4< %s\n", nextline);
+               g_free(nextline);
+
+               while (isspace(*cur_pos)) cur_pos++;
+       }
 
        if (!strncmp(cur_pos, "NIL", 3)) {
                *dest = '\0';
@@ -1753,21 +1766,27 @@ static gchar *imap_parse_atom(SockInfo *sock, gchar *src,
        } else if (*cur_pos == '{') {
                gchar buf[32];
                gint len;
-               gchar *nextline;
+               gint line_len = 0;
 
                cur_pos = strchr_cpy(cur_pos + 1, '}', buf, sizeof(buf));
                len = atoi(buf);
 
-               if ((nextline = sock_getline(sock)) == NULL)
-                       return cur_pos;
-               strretchomp(nextline);
-               log_print("IMAP4< %s\n", nextline);
-               g_string_assign(str, nextline);
+               g_string_truncate(str, 0);
+               cur_pos = str->str;
+
+               do {
+                       if ((nextline = sock_getline(sock)) == NULL)
+                               return cur_pos;
+                       line_len += strlen(nextline);
+                       g_string_append(str, nextline);
+                       strretchomp(nextline);
+                       log_print("IMAP4< %s\n", nextline);
+                       g_free(nextline);
+               } while (line_len < len);
 
-               len = MIN(len, strlen(nextline));
-               memcpy(dest, nextline, MIN(len, dest_len - 1));
+               memcpy(dest, cur_pos, MIN(len, dest_len - 1));
                dest[MIN(len, dest_len - 1)] = '\0';
-               cur_pos = str->str + len;
+               cur_pos += len;
        }
 
        return cur_pos;