diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | ChangeLog.ja | 7 | ||||
-rw-r--r-- | libsylph/utils.c | 20 | ||||
-rw-r--r-- | libsylph/utils.h | 3 | ||||
-rw-r--r-- | src/compose.c | 12 |
5 files changed, 40 insertions, 9 deletions
@@ -1,3 +1,10 @@ +2007-03-30 + + * libsylph/utils.[ch]: scan_mailto_url(): added an argument for + in-reply-to header. + * src/compose.c: supported In-Reply-To header in mailto URL (thanks + to Laurent Bigonville). + 2007-03-29 * src/main.c: app_will_exit(): force process termination (fixes diff --git a/ChangeLog.ja b/ChangeLog.ja index 90daf3a6..e0aec6e4 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,3 +1,10 @@ +2007-03-30 + + * libsylph/utils.[ch]: scan_mailto_url(): in-reply-to ヘッダの + 引数を追加。 + * src/compose.c: mailto URL 中の In-Reply-To ヘッダに対応(Laurent + Bigonville さん thanks)。 + 2007-03-29 * src/main.c: app_will_exit(): 強制的にプロセスを終了するように diff --git a/libsylph/utils.c b/libsylph/utils.c index 85758fe3..c80809fb 100644 --- a/libsylph/utils.c +++ b/libsylph/utils.c @@ -1,6 +1,6 @@ /* * LibSylph -- E-Mail client library - * Copyright (C) 1999-2006 Hiroyuki Yamamoto + * Copyright (C) 1999-2007 Hiroyuki Yamamoto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -1725,7 +1725,7 @@ gchar *uriencode_for_filename(const gchar *filename) } gint scan_mailto_url(const gchar *mailto, gchar **to, gchar **cc, gchar **bcc, - gchar **subject, gchar **body) + gchar **subject, gchar **inreplyto, gchar **body) { gchar *tmp_mailto; gchar *p; @@ -1741,8 +1741,10 @@ gint scan_mailto_url(const gchar *mailto, gchar **to, gchar **cc, gchar **bcc, p++; } - if (to && !*to) - *to = g_strdup(tmp_mailto); + if (to && !*to) { + *to = g_malloc(strlen(tmp_mailto) + 1); + decode_uri(*to, tmp_mailto); + } while (p) { gchar *field, *value; @@ -1765,13 +1767,19 @@ gint scan_mailto_url(const gchar *mailto, gchar **to, gchar **cc, gchar **bcc, if (*value == '\0') continue; if (cc && !*cc && !g_ascii_strcasecmp(field, "cc")) { - *cc = g_strdup(value); + *cc = g_malloc(strlen(value) + 1); + decode_uri(*cc, value); } else if (bcc && !*bcc && !g_ascii_strcasecmp(field, "bcc")) { - *bcc = g_strdup(value); + *bcc = g_malloc(strlen(value) + 1); + decode_uri(*bcc, value); } else if (subject && !*subject && !g_ascii_strcasecmp(field, "subject")) { *subject = g_malloc(strlen(value) + 1); decode_uri(*subject, value); + } else if (inreplyto && !*inreplyto && + !g_ascii_strcasecmp(field, "in-reply-to")) { + *inreplyto = g_malloc(strlen(value) + 1); + decode_uri(*inreplyto, value); } else if (body && !*body && !g_ascii_strcasecmp(field, "body")) { *body = g_malloc(strlen(value) + 1); diff --git a/libsylph/utils.h b/libsylph/utils.h index 4e699a1d..62664077 100644 --- a/libsylph/utils.h +++ b/libsylph/utils.h @@ -1,6 +1,6 @@ /* * LibSylph -- E-Mail client library - * Copyright (C) 1999-2006 Hiroyuki Yamamoto + * Copyright (C) 1999-2007 Hiroyuki Yamamoto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -360,6 +360,7 @@ gint scan_mailto_url (const gchar *mailto, gchar **cc, gchar **bcc, gchar **subject, + gchar **inreplyto, gchar **body); void set_startup_dir (void); diff --git a/src/compose.c b/src/compose.c index 959c3cb6..d1979af1 100644 --- a/src/compose.c +++ b/src/compose.c @@ -1277,9 +1277,10 @@ static void compose_entries_set(Compose *compose, const gchar *mailto) gchar *to = NULL; gchar *cc = NULL; gchar *subject = NULL; + gchar *inreplyto = NULL; gchar *body = NULL; - scan_mailto_url(mailto, &to, &cc, NULL, &subject, &body); + scan_mailto_url(mailto, &to, &cc, NULL, &subject, &inreplyto, &body); if (to) compose_entry_set(compose, to, COMPOSE_ENTRY_TO); @@ -1287,6 +1288,12 @@ static void compose_entries_set(Compose *compose, const gchar *mailto) compose_entry_set(compose, cc, COMPOSE_ENTRY_CC); if (subject) compose_entry_set(compose, subject, COMPOSE_ENTRY_SUBJECT); + if (inreplyto) { + if (strchr(inreplyto, '<')) + extract_parenthesis(inreplyto, '<', '>'); + remove_space(inreplyto); + compose->inreplyto = g_strdup(inreplyto); + } if (body) { GtkTextView *text = GTK_TEXT_VIEW(compose->text); GtkTextBuffer *buffer; @@ -1311,6 +1318,7 @@ static void compose_entries_set(Compose *compose, const gchar *mailto) g_free(to); g_free(cc); g_free(subject); + g_free(inreplyto); g_free(body); } @@ -1424,7 +1432,7 @@ static gint compose_parse_header(Compose *compose, MsgInfo *msginfo) extract_address(hentry[H_LIST_POST].body); if (hentry[H_LIST_POST].body[0] != '\0') { scan_mailto_url(hentry[H_LIST_POST].body, - &to, NULL, NULL, NULL, NULL); + &to, NULL, NULL, NULL, NULL, NULL); if (to) { g_free(compose->ml_post); compose->ml_post = to; |