aboutsummaryrefslogtreecommitdiff
path: root/src/compose.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-12-08 09:40:09 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-12-08 09:40:09 +0000
commit250608fdd38ac19b93609e7c88a4263febf7143c (patch)
tree8a022394f5d50949bb718654ee7af857a1fbbc6f /src/compose.c
parentdca30a04e7c82a23f4c45777f31c10180f2f37ed (diff)
added the option to input signature directly.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1408 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/compose.c')
-rw-r--r--src/compose.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/compose.c b/src/compose.c
index 359cbe42..a92db7df 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -1811,8 +1811,36 @@ static gchar *compose_get_signature_str(Compose *compose)
g_return_val_if_fail(compose->account != NULL, NULL);
+ if (compose->account->sig_type == SIG_DIRECT) {
+ gchar *p, *sp;
+
+ if (!compose->account->sig_text)
+ return NULL;
+
+ sp = compose->account->sig_text;
+ p = sig_body = g_malloc(strlen(compose->account->sig_text) + 1);
+ while (*sp) {
+ if (*sp == '\\' && *(sp + 1) == 'n') {
+ *p++ = '\n';
+ sp += 2;
+ } else
+ *p++ = *sp++;
+ }
+ *p = '\0';
+
+ if (prefs_common.sig_sep) {
+ utf8_sig_str = g_strconcat(prefs_common.sig_sep, "\n",
+ sig_body, NULL);
+ g_free(sig_body);
+ } else
+ utf8_sig_str = sig_body;
+
+ return utf8_sig_str;
+ }
+
if (!compose->account->sig_path)
return NULL;
+
if (g_path_is_absolute(compose->account->sig_path) ||
compose->account->sig_type == SIG_COMMAND)
sig_path = g_strdup(compose->account->sig_path);