From 4d35c86401b4a947689eac375ec4ba29b3c99d6d Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Sun, 19 Apr 2020 11:27:26 -0400 Subject: Use template system for paths and URLs This probably still needs a lot of cleaning up. --- atom.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'atom.c') diff --git a/atom.c b/atom.c index 1c4d0de..405bf39 100644 --- a/atom.c +++ b/atom.c @@ -51,10 +51,11 @@ static int atomAuthor(FILE *file, struct Address addr) { static char *atomEntryURL(const struct Envelope *envelope) { struct Variable vars[] = { - { "name", pathSafe(envelope->messageID) }, + { "messageID", envelope->messageID }, + { "type", "mbox" }, {0}, }; - return templateURL("/message/[name].mbox", vars); + return templateURL("/" PATH_MESSAGE, vars); } int atomEntryOpen(FILE *file, const struct Envelope *envelope) { @@ -102,11 +103,11 @@ int atomEntryClose(FILE *file) { static char *atomFeedURL(const struct Envelope *envelope, const char *type) { struct Variable vars[] = { - { "name", pathSafe(envelope->messageID) }, + { "messageID", envelope->messageID }, { "type", type }, {0}, }; - return templateURL("/thread/[name].[type]", vars); + return templateURL("/" PATH_THREAD, vars); } int atomFeedOpen(FILE *file, const struct Envelope *envelope) { -- cgit 1.4.1