aboutsummaryrefslogtreecommitdiff
path: root/libsylph
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2009-12-21 07:35:15 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2009-12-21 07:35:15 +0000
commit19453aea34c35def050511678fa4244c0ecdabb5 (patch)
tree7edba71c5c8b2a6a4e26f00b2432a2ae325ef12e /libsylph
parent96ac773bf82363529a25fd85cb32e53cc0faa10a (diff)
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
Diffstat (limited to 'libsylph')
-rw-r--r--libsylph/libsylph-0.def1
-rw-r--r--libsylph/prefs_common.c2
-rw-r--r--libsylph/prefs_common.h4
-rw-r--r--libsylph/utils.c24
-rw-r--r--libsylph/utils.h2
5 files changed, 31 insertions, 2 deletions
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,