summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--html.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/html.c b/html.c
index e404434..f078b75 100644
--- a/html.c
+++ b/html.c
@@ -30,7 +30,7 @@ static const char *Mailto = {
 static const char *Summary = TEMPLATE(
 	<details class="message" id="[messageID]">
 	<summary>
-		<h1 class="subject"><a href="#[messageID]">[subject]</a></h1>
+		<h1 class="subject"><a href="[fragment]">[subject]</a></h1>
 		<address class="from"><a href="[mailto]">[from]</a></address>
 		<time datetime="[utc]">[date]</time>
 	</summary>
@@ -41,6 +41,12 @@ static const char *Address = TEMPLATE(
 );
 
 int htmlEnvelope(FILE *file, const struct Envelope *envelope) {
+	struct Variable fragmentVars[] = {
+		{ "messageID", envelope->messageID },
+		{0},
+	};
+	char *fragment = templateURL("#[messageID]", fragmentVars);
+
 	struct Variable mailtoVars[] = {
 		{ "mailbox", envelope->replyTo.mailbox },
 		{ "host", envelope->replyTo.host },
@@ -62,6 +68,7 @@ int htmlEnvelope(FILE *file, const struct Envelope *envelope) {
 
 	struct Variable summaryVars[] = {
 		{ "messageID", envelope->messageID },
+		{ "fragment", fragment },
 		{ "subject", envelope->subject },
 		{ "mailto", mailto },
 		{ "from", from },
@@ -70,6 +77,7 @@ int htmlEnvelope(FILE *file, const struct Envelope *envelope) {
 		{0},
 	};
 	int error = templateRender(file, Summary, summaryVars, escapeXML);
+	free(fragment);
 	free(mailto);
 	if (error) return error;
 
light'> 2019-11-08Check that password is hashedJune McEnroe 2019-11-08Avoid calling getopt_long again after it returns -1June McEnroe On GNU, calling getopt_long again will reset optind back to the first non-option argument, which would cause an infinite loop of reading the same configurtion file forever. 2019-11-08Only change AWAY status for registered clientsJune McEnroe Turns out I did eventually fix this, because I may want to implement "passive clients" for logging or notification stuff, which wouldn't affect AWAY status either. 2019-11-07Just write the example normallyJune McEnroe 2019-11-07Include path in readlinkat errorJune McEnroe 2019-11-07Call clientConsume before clientRecvJune McEnroe This might reduce the frequency of a client getting its own message back because it was behind in the ring when it sent it. 2019-11-06Use -l:filename in Linux.mkJune McEnroe 2019-11-06Fix compat.h for #defined strlcpyJune McEnroe 2019-11-06Allow unsetting LIBRESSL_PREFIXJune McEnroe 2019-11-06Document calico service configurationJune McEnroe 2019-11-06Document SASL EXTERNAL configuration in more detailJune McEnroe 2019-11-06Document pounce service configurationJune McEnroe 2019-11-06Mention Darwin and GNU/Linux in READMEJune McEnroe 2019-11-06Assume LibreSSL from brew on DarwinJune McEnroe 2019-11-06Remove -DNO_EXPLICIT_BZERO from Darwin.mkJune McEnroe 2019-11-06Don't install rc scripts or dirs on LinuxJune McEnroe