From 19453aea34c35def050511678fa4244c0ecdabb5 Mon Sep 17 00:00:00 2001 From: hiro Date: Mon, 21 Dec 2009 07:35:15 +0000 Subject: added option to set only mail address of recipients when replying. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2404 ee746299-78ed-0310-b773-934348b2243d --- libsylph/libsylph-0.def | 1 + libsylph/prefs_common.c | 2 ++ libsylph/prefs_common.h | 4 ++-- libsylph/utils.c | 24 ++++++++++++++++++++++++ libsylph/utils.h | 2 ++ 5 files changed, 31 insertions(+), 2 deletions(-) (limited to 'libsylph') diff --git a/libsylph/libsylph-0.def b/libsylph/libsylph-0.def index 20df1f10..55f43a52 100644 --- a/libsylph/libsylph-0.def +++ b/libsylph/libsylph-0.def @@ -671,3 +671,4 @@ EXPORTS xml_unescape_str @ 669 strcasestr_with_skip_quote @ 670 is_path_parent @ 671 + extract_addresses @ 672 diff --git a/libsylph/prefs_common.c b/libsylph/prefs_common.c index 83982c8d..08091f5f 100644 --- a/libsylph/prefs_common.c +++ b/libsylph/prefs_common.c @@ -90,6 +90,8 @@ static PrefParam param[] = { P_BOOL}, {"inherit_recipient_on_self_reply", "FALSE", &prefs_common.inherit_recipient_on_self_reply, P_BOOL}, + {"reply_address_only", "FALSE", + &prefs_common.reply_address_only, P_BOOL}, {"show_ruler", "TRUE", &prefs_common.show_ruler, P_BOOL}, diff --git a/libsylph/prefs_common.h b/libsylph/prefs_common.h index cd3c1e54..e5bd7f6a 100644 --- a/libsylph/prefs_common.h +++ b/libsylph/prefs_common.h @@ -310,8 +310,8 @@ struct _PrefsCommon gboolean online_mode; /* Append new members here */ - /* Display */ - gboolean folder_col_visible[4]; + gboolean folder_col_visible[4]; /* Display */ + gboolean reply_address_only; /* Compose */ }; extern PrefsCommon prefs_common; diff --git a/libsylph/utils.c b/libsylph/utils.c index 3a14e690..e9eba77a 100644 --- a/libsylph/utils.c +++ b/libsylph/utils.c @@ -947,6 +947,30 @@ void extract_list_id_str(gchar *str) g_strstrip(str); } +gchar *extract_addresses(const gchar *str) +{ + GString *new_str; + GSList *addr_list, *cur; + + if (!str) + return NULL; + + addr_list = address_list_append(NULL, str); + + new_str = g_string_new(NULL); + + for (cur = addr_list; cur != NULL; cur = cur->next) { + g_string_append(new_str, (gchar *)cur->data); + if (cur->next) + g_string_append(new_str, ", "); + } + + slist_free_strings(addr_list); + g_slist_free(addr_list); + + return g_string_free(new_str, FALSE); +} + gchar *normalize_address_field(const gchar *str) { GString *new_str; diff --git a/libsylph/utils.h b/libsylph/utils.h index c911fa5f..9e5efeb0 100644 --- a/libsylph/utils.h +++ b/libsylph/utils.h @@ -298,6 +298,8 @@ gchar *strrchr_with_skip_quote (const gchar *str, void extract_address (gchar *str); void extract_list_id_str (gchar *str); +gchar *extract_addresses (const gchar *str); + gchar *normalize_address_field (const gchar *str); gboolean address_equal (const gchar *addr1, -- cgit v1.2.3