From 216dfe62291ff6e2f1d3211a0d1175b2eace4a20 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Mon, 30 Nov 2020 01:36:15 -0500 Subject: Move reply link to message nav --- html.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/html.c b/html.c index 4269871..95afe4d 100644 --- a/html.c +++ b/html.c @@ -147,31 +147,37 @@ htmlNavItem(FILE *file, const char *name, const char *base, const char *url) { return templateRender(file, template, vars, escapeXML); } +static int htmlParent(FILE *file, const struct Envelope *envelope) { + if (!envelope->inReplyTo) return 0; + char *fragment = htmlFragment(envelope->inReplyTo); + int error = htmlNavItem(file, "parent", "", fragment); + free(fragment); + return error; +} + int htmlMessageNav(FILE *file, const struct Envelope *envelope) { char *mbox = htmlMbox(envelope->messageID); + char *reply = htmlReply(envelope); int error = 0 || templateRender(file, Q(), NULL, NULL); free(mbox); - if (envelope->inReplyTo) { - char *fragment = htmlFragment(envelope->inReplyTo); - error = htmlNavItem(file, "parent", "", fragment); - free(fragment); - if (error) return error; - } - return templateRender(file, Q(), NULL, NULL); + free(reply); + return error; } int htmlMessageOpen(FILE *file, const struct Envelope *envelope) { char *fragment = htmlFragment(envelope->messageID); - char *reply = htmlReply(envelope); + char *mailto = htmlMailto(envelope->from); const char *template = Q(

[subject]

- From: [from] + From: [from]
); @@ -179,7 +185,7 @@ int htmlMessageOpen(FILE *file, const struct Envelope *envelope) { { "messageID", envelope->messageID }, { "fragment", fragment }, { "subject", envelope->subject }, - { "reply", reply }, + { "mailto", mailto }, { "from", addressName(envelope->from) }, { "utc", iso8601(envelope->time).s }, { "date", envelope->date }, @@ -192,7 +198,7 @@ int htmlMessageOpen(FILE *file, const struct Envelope *envelope) { || htmlMessageNav(file, envelope) || templateRender(file, Q(
), NULL, NULL); free(fragment); - free(reply); + free(mailto); return error; } -- cgit 1.4.1