From: Jani Nikula <jani@nikula.org>
To: notmuch@notmuchmail.org
Subject: [PATCH v2 2/3] cli: add reply.honor_followup_to configuration option
Date: Sat, 30 Mar 2013 16:21:21 +0200 [thread overview]
Message-ID: <698d81ea04495c4315ff7da603f3e54eed1d24f1.1364652420.git.jani@nikula.org> (raw)
In-Reply-To: <cover.1364652420.git.jani@nikula.org>
In-Reply-To: <cover.1364652420.git.jani@nikula.org>
The reply.honor_followup_to configuration option determines whether
notmuch reply takes into account the Mail-Followup-To: header in
incoming messages.
---
notmuch-client.h | 7 +++++++
notmuch-config.c | 43 +++++++++++++++++++++++++++++++++++++++++++
2 files changed, 50 insertions(+)
diff --git a/notmuch-client.h b/notmuch-client.h
index 45749a6..0b7800c 100644
--- a/notmuch-client.h
+++ b/notmuch-client.h
@@ -301,6 +301,13 @@ notmuch_config_set_new_ignore (notmuch_config_t *config,
size_t length);
notmuch_bool_t
+notmuch_config_get_reply_honor_followup_to (notmuch_config_t *config);
+
+void
+notmuch_config_set_reply_honor_followup_to (notmuch_config_t *config,
+ notmuch_bool_t honor_followup_to);
+
+notmuch_bool_t
notmuch_config_get_maildir_synchronize_flags (notmuch_config_t *config);
void
diff --git a/notmuch-config.c b/notmuch-config.c
index 66a1cdf..053038e 100644
--- a/notmuch-config.c
+++ b/notmuch-config.c
@@ -53,6 +53,17 @@ static const char new_config_comment[] =
"\t names will be ignored, independent of its depth/location\n"
"\t in the mail store.\n";
+static const char reply_config_comment[] =
+ " Configuration for \"notmuch reply\"\n"
+ "\n"
+ " The following option is supported here:\n"
+ "\n"
+ "\thonor_followup_to Valid values are true and false.\n"
+ "\n"
+ "\tIf true, \"notmuch reply\" will honor the \"Mail-Followup-To:\""
+ "\theader in incoming messages. (This will not generate the headers"
+ "\tto outgoing messages.)\n";
+
static const char user_config_comment[] =
" User configuration\n"
"\n"
@@ -115,6 +126,7 @@ struct _notmuch_config {
size_t new_tags_length;
const char **new_ignore;
size_t new_ignore_length;
+ notmuch_bool_t reply_honor_followup_to;
notmuch_bool_t maildir_synchronize_flags;
const char **search_exclude_tags;
size_t search_exclude_tags_length;
@@ -240,6 +252,7 @@ notmuch_config_open (void *ctx,
char *notmuch_config_env = NULL;
int file_had_database_group;
int file_had_new_group;
+ int file_had_reply_group;
int file_had_user_group;
int file_had_maildir_group;
int file_had_search_group;
@@ -273,6 +286,7 @@ notmuch_config_open (void *ctx,
config->new_tags_length = 0;
config->new_ignore = NULL;
config->new_ignore_length = 0;
+ config->reply_honor_followup_to = FALSE;
config->maildir_synchronize_flags = TRUE;
config->search_exclude_tags = NULL;
config->search_exclude_tags_length = 0;
@@ -316,6 +330,7 @@ notmuch_config_open (void *ctx,
file_had_database_group = g_key_file_has_group (config->key_file,
"database");
file_had_new_group = g_key_file_has_group (config->key_file, "new");
+ file_had_reply_group = g_key_file_has_group (config->key_file, "reply");
file_had_user_group = g_key_file_has_group (config->key_file, "user");
file_had_maildir_group = g_key_file_has_group (config->key_file, "maildir");
file_had_search_group = g_key_file_has_group (config->key_file, "search");
@@ -383,6 +398,15 @@ notmuch_config_open (void *ctx,
}
error = NULL;
+ config->reply_honor_followup_to =
+ g_key_file_get_boolean (config->key_file,
+ "reply", "honor_followup_to", &error);
+ if (error) {
+ notmuch_config_set_reply_honor_followup_to (config, FALSE);
+ g_error_free (error);
+ }
+
+ error = NULL;
config->maildir_synchronize_flags =
g_key_file_get_boolean (config->key_file,
"maildir", "synchronize_flags", &error);
@@ -406,6 +430,10 @@ notmuch_config_open (void *ctx,
g_key_file_set_comment (config->key_file, "new", NULL,
new_config_comment, NULL);
+ if (! file_had_reply_group)
+ g_key_file_set_comment (config->key_file, "reply", NULL,
+ reply_config_comment, NULL);
+
if (! file_had_user_group)
g_key_file_set_comment (config->key_file, "user", NULL,
user_config_comment, NULL);
@@ -845,6 +873,21 @@ notmuch_config_command (notmuch_config_t *config, int argc, char *argv[])
}
notmuch_bool_t
+notmuch_config_get_reply_honor_followup_to (notmuch_config_t *config)
+{
+ return config->reply_honor_followup_to;
+}
+
+void
+notmuch_config_set_reply_honor_followup_to (notmuch_config_t *config,
+ notmuch_bool_t honor_followup_to)
+{
+ g_key_file_set_boolean (config->key_file,
+ "reply", "honor_followup_to", honor_followup_to);
+ config->reply_honor_followup_to = honor_followup_to;
+}
+
+notmuch_bool_t
notmuch_config_get_maildir_synchronize_flags (notmuch_config_t *config)
{
return config->maildir_synchronize_flags;
--
1.7.10.4
next prev parent reply other threads:[~2013-03-30 14:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-30 14:21 [PATCH v2 0/3] cli: mail-followup-to support Jani Nikula
2013-03-30 14:21 ` [PATCH v2 1/3] cli: config: remove unnecessary braces from if blocks Jani Nikula
2013-03-30 22:36 ` David Bremner
2013-03-30 14:21 ` Jani Nikula [this message]
2013-03-30 14:21 ` [PATCH v2 3/3] cli: support Mail-Followup-To: in notmuch reply Jani Nikula
2013-05-11 20:05 ` [PATCH v2 0/3] cli: mail-followup-to support Mark Walters
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=698d81ea04495c4315ff7da603f3e54eed1d24f1.1364652420.git.jani@nikula.org \
--to=jani@nikula.org \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).