diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ChangeLog.ja | 6 | ||||
-rw-r--r-- | libsylph/procheader.c | 25 | ||||
-rw-r--r-- | libsylph/procheader.h | 1 | ||||
-rw-r--r-- | src/summaryview.c | 8 |
5 files changed, 44 insertions, 1 deletions
@@ -1,5 +1,10 @@ 2007-09-13 + * libsylph/procheader.[ch]: procheader_get_toname(): added. + * src/summaryview.c: summary_set_row(): simplify To headers. + +2007-09-13 + * libsylph/procmsg.[ch]: procmsg_set_auto_decrypt_message(): added. * src/query_search.c: query_search_folder(): disabled the passphrase dialog on query search. diff --git a/ChangeLog.ja b/ChangeLog.ja index 6e8bc3ee..f8c4e7e0 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,5 +1,11 @@ 2007-09-13 + * libsylph/procheader.[ch]: procheader_get_toname(): 追加。 + * src/summaryview.c: summary_set_row(): To ヘッダを簡略化するように + した。 + +2007-09-13 + * libsylph/procmsg.[ch]: procmsg_set_auto_decrypt_message(): 追加。 * src/query_search.c: query_search_folder(): クエリ検索時はパス フレーズダイアログを出さないようにした。 diff --git a/libsylph/procheader.c b/libsylph/procheader.c index 2c931e07..22a8acc5 100644 --- a/libsylph/procheader.c +++ b/libsylph/procheader.c @@ -775,6 +775,31 @@ gchar *procheader_get_fromname(const gchar *str) return name; } +gchar *procheader_get_toname(const gchar *str) +{ + GSList *addr_list, *cur; + GString *toname; + gchar *name; + + if (strchr(str, ',') == NULL) + return procheader_get_fromname(str); + + addr_list = address_list_append_orig(NULL, str); + toname = g_string_new(NULL); + + for (cur = addr_list; cur != NULL; cur = cur->next) { + name = procheader_get_fromname((gchar *)cur->data); + g_string_append(toname, name); + g_free(name); + if (cur->next) + g_string_append(toname, ", "); + } + + slist_free_strings(addr_list); + + return g_string_free(toname, FALSE); +} + static gint procheader_scan_date_string(const gchar *str, gchar *weekday, gint *day, gchar *month, gint *year, diff --git a/libsylph/procheader.h b/libsylph/procheader.h index 6054f5d3..0260b45e 100644 --- a/libsylph/procheader.h +++ b/libsylph/procheader.h @@ -89,6 +89,7 @@ MsgInfo *procheader_parse_stream (FILE *fp, gboolean full); gchar *procheader_get_fromname (const gchar *str); +gchar *procheader_get_toname (const gchar *str); time_t procheader_date_parse (gchar *dest, const gchar *src, diff --git a/src/summaryview.c b/src/summaryview.c index 6c653b3b..6799dec4 100644 --- a/src/summaryview.c +++ b/src/summaryview.c @@ -2291,6 +2291,7 @@ static void summary_set_row(SummaryView *summaryview, GtkTreeIter *iter, const gchar *date_s; gchar *sw_from_s = NULL; gchar *subject_s = NULL; + gchar *to_s = NULL; GdkPixbuf *mark_pix = NULL; GdkPixbuf *unread_pix = NULL; GdkPixbuf *mime_pix = NULL; @@ -2329,6 +2330,9 @@ static void summary_set_row(SummaryView *summaryview, GtkTreeIter *iter, } } + if (msginfo->to) + to_s = procheader_get_toname(msginfo->to); + flags = msginfo->flags; /* set flag pixbufs */ @@ -2392,7 +2396,7 @@ static void summary_set_row(SummaryView *summaryview, GtkTreeIter *iter, S_COL_DATE, date_s, S_COL_SIZE, to_human_readable(msginfo->size), S_COL_NUMBER, msginfo->msgnum, - S_COL_TO, msginfo->to ? msginfo->to : "", + S_COL_TO, to_s ? to_s : "", S_COL_MSG_INFO, msginfo, @@ -2402,6 +2406,8 @@ static void summary_set_row(SummaryView *summaryview, GtkTreeIter *iter, S_COL_BOLD, weight, -1); + if (to_s) + g_free(to_s); if (subject_s) g_free(subject_s); if (sw_from_s) |