From f3ed92028a4873531d24eb1c317d276f165ac7a8 Mon Sep 17 00:00:00 2001 From: Paul Mangan Date: Wed, 27 Mar 2002 09:38:08 +0000 Subject: [PATCH 1/1] sync with 0.7.4cvs21 --- ChangeLog | 14 ++++++++++++++ ChangeLog.claws | 5 +++++ ChangeLog.jp | 13 +++++++++++++ configure.in | 2 +- src/compose.c | 38 ++++++++++++++++++++++++++++++++++---- src/imap.c | 39 +++++++++++++++++++++++++++++---------- 6 files changed, 96 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 11d45701a..86c53bce8 100644 --- 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 diff --git a/ChangeLog.claws b/ChangeLog.claws index 2a4a8cd2d..54cfeeb0e 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -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 diff --git a/ChangeLog.jp b/ChangeLog.jp index ea8c4f418..71842e7e2 100644 --- a/ChangeLog.jp +++ b/ChangeLog.jp @@ -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(): ¥Æ¥­¥¹¥È¤ÎŤµ¤¬Â礭¤¤¤È¤­¤Ë diff --git a/configure.in b/configure.in index a5df16e8d..22cd7abc4 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=claws47 +EXTRA_VERSION=claws48 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION dnl set $target diff --git a/src/compose.c b/src/compose.c index 65a210868..7d29e8df5 100644 --- a/src/compose.c +++ b/src/compose.c @@ -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; diff --git a/src/imap.c b/src/imap.c index a684338d0..4884a5ddb 100644 --- a/src/imap.c +++ b/src/imap.c @@ -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; -- 2.25.1