diff options
author | June McEnroe <june@causal.agency> | 2020-04-19 11:27:26 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2020-04-20 11:17:56 -0400 |
commit | 4d35c86401b4a947689eac375ec4ba29b3c99d6d (patch) | |
tree | 70b71841a1114c88f4d4c0bea0e645ff3b301ca7 /atom.c | |
parent | Skip leading whitespace in message IDs (diff) | |
download | bubger-4d35c86401b4a947689eac375ec4ba29b3c99d6d.tar.gz bubger-4d35c86401b4a947689eac375ec4ba29b3c99d6d.zip |
Use template system for paths and URLs
This probably still needs a lot of cleaning up.
Diffstat (limited to '')
-rw-r--r-- | atom.c | 9 |
1 files changed, 5 insertions, 4 deletions
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) { |