summary refs log tree commit diff
path: root/concat.c
diff options
context:
space:
mode:
Diffstat (limited to 'concat.c')
-rw-r--r--concat.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/concat.c b/concat.c
index 2c58d8a..eeab073 100644
--- a/concat.c
+++ b/concat.c
@@ -119,14 +119,36 @@ void concatData(struct List threads, struct List items) {
 	if (error || file.st_mtime < uidNewest(flat, "mbox")) {
 		FILE *mbox = fopen(path, "w");
 		if (!mbox) err(EX_CANTCREAT, "%s", path);
+
 		for (size_t i = 0; i < flat.len; ++i) {
 			uint32_t uid = dataCheck(flat.ptr[i], Number).number;
 			error = concatFile(mbox, uidPath(uid, "mbox"));
 			if (error) err(EX_IOERR, "%s", path);
 		}
+
 		error = fclose(mbox);
 		if (error) err(EX_IOERR, "%s", path);
 	}
 
+	path = threadPath(envelope.messageID, "atom");
+	error = stat(path, &file);
+	if (error || file.st_mtime < uidNewest(flat, "atom")) {
+		FILE *atom = fopen(path, "w");
+		if (!atom) err(EX_CANTCREAT, "%s", path);
+
+		error = atomFeedHead(atom, &envelope);
+		if (error) err(EX_IOERR, "%s", path);
+
+		for (size_t i = 0; i < flat.len; ++i) {
+			uint32_t uid = dataCheck(flat.ptr[i], Number).number;
+			error = concatFile(atom, uidPath(uid, "atom"));
+			if (error) err(EX_IOERR, "%s", path);
+		}
+
+		error = atomFeedTail(atom)
+			|| fclose(atom);
+		if (error) err(EX_IOERR, "%s", path);
+	}
+
 	listFree(flat);
 }
class='tag-annotated-deco' href='/litterbox/tag/?h=1.2'>1.2June McEnroe 2020-04-05Only set RCS on FreeBSDJune McEnroe 2020-04-05Log bans and unbansJune McEnroe 2020-04-05Parse mode types from ISUPPORTJune McEnroe 2020-04-05Add unscoop matchers for ban/unban eventsJune McEnroe The IRC and Textual matchers miss bans mixed with other mode changes, but those are rare. 2020-04-05Check unscoop regexps with make testJune McEnroe 2020-04-05Add unscoop -n flag for checking regexpsJune McEnroe 2020-04-05Add Ban and Unban event typesJune McEnroe 2020-04-02Update styleJune McEnroe Replacing declarations followed by while loops with for loops and generating the short option string from the long options. 2020-03-31Update unscoop catgirl matchersJune McEnroe I'm not concerned about keeping the old matchers since I'm almost entirely certain I was the only one who ever used the old version of catgirl, and I already imported those logs. 2020-03-31Fix writing verbose to stderrJune McEnroe 2020-03-02Include <>/-/* around nicks in scoop coloring 1.1June McEnroe 2020-03-02Replace .mk files with configure scriptJune McEnroe 2020-02-28Implement the causal.agency/consumer capabilityJune McEnroe 2020-02-22Include <>/-/* around nicks in coloringJune McEnroe 2020-02-22Use (almost) the full range of IRC colors for nicksJune McEnroe