summary refs log tree commit diff
path: root/html.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-05-19 18:05:31 -0400
committerJune McEnroe <june@causal.agency>2021-05-19 18:05:31 -0400
commit21b5983bfbebf24da5b62c1dab8ce96e76e07d43 (patch)
tree3a43ce50c2601f6e0550e95ca3f6793a49ccecee /html.c
parentReplace freenode with tilde.chat (diff)
downloadscooper-21b5983bfbebf24da5b62c1dab8ce96e76e07d43.tar.gz
scooper-21b5983bfbebf24da5b62c1dab8ce96e76e07d43.zip
Add -h flag to hide user hostnames 1.2
Diffstat (limited to '')
-rw-r--r--html.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/html.c b/html.c
index 21dca9f..f300813 100644
--- a/html.c
+++ b/html.c
@@ -28,6 +28,7 @@
 
 #include "server.h"
 
+bool htmlHideHost;
 const char *htmlStylesheet = "stylesheet.css";
 
 static enum kcgi_err htmlCSS(struct khtmlreq *html, struct kreq *req) {
@@ -372,7 +373,10 @@ eventNick(struct khtmlreq *html, const struct Event *event) {
 		class, sizeof(class), "fg%02d",
 		hash(strcmp(event->user, "*") ? event->user : event->nick)
 	);
-	asprintf(&mask, "%s!%s@%s", event->nick, event->user, event->host);
+	asprintf(
+		&mask, "%s!%s@%s",
+		event->nick, event->user, (htmlHideHost ? "*" : event->host)
+	);
 	if (!mask) err(EX_OSERR, "asprintf");
 	const char *format = "%s";
 	switch (event->type) {