aboutsummaryrefslogtreecommitdiff
path: root/libsylph
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2007-09-13 07:28:49 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2007-09-13 07:28:49 +0000
commit60afaca7f0fc0eafad37b26bfd7050470da9b994 (patch)
treecba0b5c24f892acf8c8c10a34c95fc99c154a4f8 /libsylph
parent9026c5444aa126d97995f8f9b1c826109545d9f1 (diff)
simplify To headers on summary view.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1897 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph')
-rw-r--r--libsylph/procheader.c25
-rw-r--r--libsylph/procheader.h1
2 files changed, 26 insertions, 0 deletions
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,