about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--README.72
-rw-r--r--archive.c2
-rw-r--r--archive.h2
-rw-r--r--atom.c40
-rw-r--r--bubger.111
-rw-r--r--compat.c2
-rw-r--r--concat.c2
-rw-r--r--decode.c2
-rw-r--r--export.c2
-rw-r--r--getservinfo.c2
-rw-r--r--html.c2
-rw-r--r--imap.c2
-rw-r--r--imap.h2
-rw-r--r--mbox.c2
-rw-r--r--parse.c2
-rw-r--r--template.c2
16 files changed, 49 insertions, 30 deletions
diff --git a/README.7 b/README.7
index 84c31ef..0cee389 100644
--- a/README.7
+++ b/README.7
@@ -91,7 +91,7 @@ Monetary contributions can be
 .Sh SEE ALSO
 .Xr bubger 1
 .Rs
-.%A June Bug
+.%A June McEnroe
 .%T Mailing List
 .%U https://text.causal.agency/019-mailing-list.txt
 .%D March 4, 2021
diff --git a/archive.c b/archive.c
index 4c0e9da..881df21 100644
--- a/archive.c
+++ b/archive.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2020  C. McEnroe <june@causal.agency>
+/* Copyright (C) 2020  June McEnroe <june@causal.agency>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/archive.h b/archive.h
index 921ae06..376f911 100644
--- a/archive.h
+++ b/archive.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2020  C. McEnroe <june@causal.agency>
+/* Copyright (C) 2020  June McEnroe <june@causal.agency>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/atom.c b/atom.c
index b49a2b7..5067425 100644
--- a/atom.c
+++ b/atom.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2020  C. McEnroe <june@causal.agency>
+/* Copyright (C) 2020  June McEnroe <june@causal.agency>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -34,17 +34,17 @@
 
 #include "archive.h"
 
-static char *atomID(const struct Envelope *envelope) {
+static char *atomID(const char *messageID) {
 	struct Variable vars[] = {
-		{ "messageID", envelope->messageID },
+		{ "messageID", messageID },
 		{0},
 	};
 	return templateString("mid:[messageID]", vars, escapeURL);
 }
 
-static char *atomEntryURL(const struct Envelope *envelope) {
+static char *atomEntryURL(const char *messageID) {
 	struct Variable vars[] = {
-		{ "messageID", envelope->messageID },
+		{ "messageID", messageID },
 		{ "type", "mbox" },
 		{0},
 	};
@@ -68,14 +68,18 @@ static int atomAuthor(FILE *file, struct Address addr) {
 }
 
 int atomEntryOpen(FILE *file, const struct Envelope *envelope) {
-	char *id = atomID(envelope);
-	char *url = atomEntryURL(envelope);
+	char *id = atomID(envelope->messageID);
+	char *url = atomEntryURL(envelope->messageID);
+	char *ref = (envelope->inReplyTo ? atomID(envelope->inReplyTo) : NULL);
 	const char *template = Q(
 		<entry>
 		<id>[id]</id>
 		<title>[title]</title>
 		<updated>[updated]</updated>
 		<link rel="alternate" type="application/mbox" href="[base][url]"/>
+		[+ref]
+		<thr:in-reply-to ref="[ref]"/>
+		[-]
 	);
 	struct Variable vars[] = {
 		{ "id", id },
@@ -83,6 +87,7 @@ int atomEntryOpen(FILE *file, const struct Envelope *envelope) {
 		{ "updated", iso8601(envelope->time).s },
 		{ "base", baseURL },
 		{ "url", url },
+		{ "ref", ref },
 		{0},
 	};
 	int error = 0
@@ -90,6 +95,7 @@ int atomEntryOpen(FILE *file, const struct Envelope *envelope) {
 		|| atomAuthor(file, envelope->from);
 	free(id);
 	free(url);
+	free(ref);
 	return error;
 }
 
@@ -112,9 +118,9 @@ int atomEntryClose(FILE *file) {
 	return templateRender(file, Q(</entry>), NULL, NULL);
 }
 
-static char *atomThreadURL(const struct Envelope *envelope, const char *type) {
+static char *atomThreadURL(const char *messageID, const char *type) {
 	struct Variable vars[] = {
-		{ "messageID", envelope->messageID },
+		{ "messageID", messageID },
 		{ "type", type },
 		{0},
 	};
@@ -124,12 +130,14 @@ static char *atomThreadURL(const struct Envelope *envelope, const char *type) {
 #define XML_DECL "<?" Q(xml version="1.0" encoding="utf-8") "?>"
 
 int atomThreadOpen(FILE *file, const struct Envelope *envelope) {
-	char *id = atomID(envelope);
-	char *atom = atomThreadURL(envelope, "atom");
-	char *html = atomThreadURL(envelope, "html");
-	char *mbox = atomThreadURL(envelope, "mbox");
+	char *id = atomID(envelope->messageID);
+	char *atom = atomThreadURL(envelope->messageID, "atom");
+	char *html = atomThreadURL(envelope->messageID, "html");
+	char *mbox = atomThreadURL(envelope->messageID, "mbox");
 	const char *template = XML_DECL Q(
-		<feed xmlns="http://www.w3.org/2005/Atom">
+		<feed
+			xmlns="http://www.w3.org/2005/Atom"
+			xmlns:thr="http://purl.org/syndication/thread/1.0">
 		<generator uri="[generator]">bubger</generator>
 		<id>[id]</id>
 		<title>[title]</title>
@@ -176,7 +184,9 @@ int atomIndexOpen(FILE *file, const char *name) {
 	char *atom = atomIndexURL(name, "atom");
 	char *html = atomIndexURL(name, "html");
 	const char *template = XML_DECL Q(
-		<feed xmlns="http://www.w3.org/2005/Atom">
+		<feed
+			xmlns="http://www.w3.org/2005/Atom"
+			xmlns:thr="http://purl.org/syndication/thread/1.0">
 		<generator uri="[generator]">bubger</generator>
 		<id>[base][atom]</id>
 		<title>[+name][name] - [-][title]</title>
diff --git a/bubger.1 b/bubger.1
index 0e5d7fe..050244e 100644
--- a/bubger.1
+++ b/bubger.1
@@ -338,10 +338,19 @@ bubger		TO "list+bubger@causal.agency"
 .%U https://tools.ietf.org/html/rfc4287
 .%D December 2005
 .Re
+.It
+.Rs
+.%A J. Snell
+.%T Atom Threading Extensions
+.%I IETF
+.%R RFC 4685
+.%U https://tools.ietf.org/html/rfc4685
+.%D September 2006
+.Re
 .El
 .
 .Sh AUTHORS
-.An June Bug Aq Mt june@causal.agency
+.An June McEnroe Aq Mt june@causal.agency
 .
 .Sh BUGS
 Send mail to
diff --git a/compat.c b/compat.c
index be72f4a..5316227 100644
--- a/compat.c
+++ b/compat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2019  C. McEnroe <june@causal.agency>
+/* Copyright (C) 2019  June McEnroe <june@causal.agency>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/concat.c b/concat.c
index 8da5a7a..c774cf9 100644
--- a/concat.c
+++ b/concat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2020  C. McEnroe <june@causal.agency>
+/* Copyright (C) 2020  June McEnroe <june@causal.agency>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/decode.c b/decode.c
index 0dbed27..795ed79 100644
--- a/decode.c
+++ b/decode.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2020  C. McEnroe <june@causal.agency>
+/* Copyright (C) 2020  June McEnroe <june@causal.agency>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/export.c b/export.c
index b7420fb..c461bc4 100644
--- a/export.c
+++ b/export.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2020  C. McEnroe <june@causal.agency>
+/* Copyright (C) 2020  June McEnroe <june@causal.agency>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/getservinfo.c b/getservinfo.c
index 219f72a..4bc4b34 100644
--- a/getservinfo.c
+++ b/getservinfo.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2020  C. McEnroe <june@causal.agency>
+/* Copyright (C) 2020  June McEnroe <june@causal.agency>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/html.c b/html.c
index 1dc531c..88e04d5 100644
--- a/html.c
+++ b/html.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2020  C. McEnroe <june@causal.agency>
+/* Copyright (C) 2020  June McEnroe <june@causal.agency>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/imap.c b/imap.c
index e875595..9cb5136 100644
--- a/imap.c
+++ b/imap.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2020  C. McEnroe <june@causal.agency>
+/* Copyright (C) 2020  June McEnroe <june@causal.agency>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/imap.h b/imap.h
index e5a925a..ae55fdc 100644
--- a/imap.h
+++ b/imap.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2020  C. McEnroe <june@causal.agency>
+/* Copyright (C) 2020  June McEnroe <june@causal.agency>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/mbox.c b/mbox.c
index 802962f..f6185d6 100644
--- a/mbox.c
+++ b/mbox.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2020  C. McEnroe <june@causal.agency>
+/* Copyright (C) 2020  June McEnroe <june@causal.agency>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/parse.c b/parse.c
index 8bfae61..13b1e81 100644
--- a/parse.c
+++ b/parse.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2020  C. McEnroe <june@causal.agency>
+/* Copyright (C) 2020  June McEnroe <june@causal.agency>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/template.c b/template.c
index e3adcd1..75fdf4e 100644
--- a/template.c
+++ b/template.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2020  C. McEnroe <june@causal.agency>
+/* Copyright (C) 2020  June McEnroe <june@causal.agency>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by