summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--cgit.c2
-rw-r--r--cgit.h1
-rw-r--r--cgitrc.5.txt4
-rw-r--r--ui-atom.c2
-rw-r--r--ui-commit.c12
-rw-r--r--ui-patch.c6
-rw-r--r--ui-tag.c2
7 files changed, 22 insertions, 7 deletions
diff --git a/cgit.c b/cgit.c
index 2039ab1..f6bb0c7 100644
--- a/cgit.c
+++ b/cgit.c
@@ -53,2 +53,4 @@ void config_cb(const char *name, const char *value)
ctx.cfg.nocache = atoi(value);
+ else if (!strcmp(name, "noplainemail"))
+ ctx.cfg.noplainemail = atoi(value);
else if (!strcmp(name, "noheader"))
diff --git a/cgit.h b/cgit.h
index 8c64efe..acb5e8f 100644
--- a/cgit.h
+++ b/cgit.h
@@ -170,2 +170,3 @@ struct cgit_config {
int nocache;
+ int noplainemail;
int noheader;
diff --git a/cgitrc.5.txt b/cgitrc.5.txt
index a207fe0..7754923 100644
--- a/cgitrc.5.txt
+++ b/cgitrc.5.txt
@@ -160,2 +160,6 @@ nocache::
+noplainemail::
+ If set to "1" showing full author email adresses will be disabled.
+ Default value: "0".
+
noheader::
diff --git a/ui-atom.c b/ui-atom.c
index e5c31d9..808b2d0 100644
--- a/ui-atom.c
+++ b/ui-atom.c
@@ -34,3 +34,3 @@ void add_entry(struct commit *commit, char *host)
}
- if (info->author_email) {
+ if (info->author_email && !ctx.cfg.noplainemail) {
mail = xstrdup(info->author_email);
diff --git a/ui-commit.c b/ui-commit.c
index 41ce70e..9fdb8ee 100644
--- a/ui-commit.c
+++ b/ui-commit.c
@@ -42,4 +42,6 @@ void cgit_print_commit(char *hex)
html_txt(info->author);
- html(" ");
- html_txt(info->author_email);
+ if (!ctx.cfg.noplainemail) {
+ html(" ");
+ html_txt(info->author_email);
+ }
html("</td><td class='right'>");
@@ -49,4 +51,6 @@ void cgit_print_commit(char *hex)
html_txt(info->committer);
- html(" ");
- html_txt(info->committer_email);
+ if (!ctx.cfg.noplainemail) {
+ html(" ");
+ html_txt(info->committer_email);
+ }
html("</td><td class='right'>");
diff --git a/ui-patch.c b/ui-patch.c
index 5d665d3..2a8f7a5 100644
--- a/ui-patch.c
+++ b/ui-patch.c
@@ -110,3 +110,7 @@ void cgit_print_patch(char *hex)
htmlf("From %s Mon Sep 17 00:00:00 2001\n", sha1_to_hex(sha1));
- htmlf("From: %s %s\n", info->author, info->author_email);
+ htmlf("From: %s", info->author);
+ if (!ctx.cfg.noplainemail) {
+ htmlf(" %s", info->author_email);
+ }
+ html("\n");
html("Date: ");
diff --git a/ui-tag.c b/ui-tag.c
index 0e056e0..a9c8670 100644
--- a/ui-tag.c
+++ b/ui-tag.c
@@ -66,3 +66,3 @@ void cgit_print_tag(char *revname)
html_txt(info->tagger);
- if (info->tagger_email) {
+ if (info->tagger_email && !ctx.cfg.noplainemail) {
html(" ");