about summary refs log tree commit diff
path: root/atom.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-04-19 11:27:26 -0400
committerJune McEnroe <june@causal.agency>2020-04-20 11:17:56 -0400
commit4d35c86401b4a947689eac375ec4ba29b3c99d6d (patch)
tree70b71841a1114c88f4d4c0bea0e645ff3b301ca7 /atom.c
parentSkip leading whitespace in message IDs (diff)
downloadbubger-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 'atom.c')
-rw-r--r--atom.c9
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) {