summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-04-10 17:42:19 -0400
committerJune McEnroe <june@causal.agency>2020-04-10 17:42:19 -0400
commit71d7aada572a6c2751d82f45869006c8a7be72c1 (patch)
tree001f9c504ade6d1db2a7ac7d50a5f0b5d73c20ec
parentConcatenate Atom threads (diff)
downloadbubger-71d7aada572a6c2751d82f45869006c8a7be72c1.tar.gz
bubger-71d7aada572a6c2751d82f45869006c8a7be72c1.zip
Use hard links for single-message mbox threads
-rw-r--r--concat.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/concat.c b/concat.c
index eeab073..45ce12d 100644
--- a/concat.c
+++ b/concat.c
@@ -22,6 +22,7 @@
 #include <stdlib.h>
 #include <sys/stat.h>
 #include <sysexits.h>
+#include <unistd.h>
 
 #include "archive.h"
 #include "imap.h"
@@ -116,7 +117,12 @@ void concatData(struct List threads, struct List items) {
 
 	path = threadPath(envelope.messageID, "mbox");
 	error = stat(path, &file);
-	if (error || file.st_mtime < uidNewest(flat, "mbox")) {
+	if (error && flat.len == 1) {
+		uint32_t uid = dataCheck(flat.ptr[0], Number).number;
+		error = link(uidPath(uid, "mbox"), path);
+		if (error) err(EX_CANTCREAT, "%s", path);
+
+	} else if (error || file.st_mtime < uidNewest(flat, "mbox")) {
 		FILE *mbox = fopen(path, "w");
 		if (!mbox) err(EX_CANTCREAT, "%s", path);
 
amp;follow=1'>Iterate through nested multiparts to find content for AtomJune McEnroe Also fixes content for multipart/signed. 2020-04-26Include Cc address in reply mailtosJune McEnroe 2020-04-26Use %R for RFC numbers in STANDARDS sectionJune McEnroe 2020-04-26Add mailto spec to STANDARDSJune McEnroe 2020-04-26Increase space between nav itemsJune McEnroe 2020-04-26Add mailto address for the archiveJune McEnroe 2020-04-26Put dates on new lines in indexJune McEnroe 2020-04-26Include <> around Message-Id in mailto: URLsJune McEnroe 2020-04-26Add link to index on thread pagesJune McEnroe 2020-04-26Fall back to Content-Type name parameter for attachmentsJune McEnroe 2020-04-26Remove margins in article.message headerJune McEnroe 2020-04-26Generate index.atomJune McEnroe 2020-04-26Generate XHTML content in Atom entriesJune McEnroe 2020-04-25Style index pageJune McEnroe 2020-04-25Render index.htmlJune McEnroe 2020-04-25Wrap <summary> replies count in <data>June McEnroe 2020-04-25Accumulate thread envelopes before concatenationJune McEnroe 2020-04-24Free envelope in concatDataJune McEnroe 2020-04-24Use replyTo address in mailto:June McEnroe 2020-04-23Wrap quoted lines in <q>June McEnroe