summary refs log tree commit diff
path: root/export.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-04-10 16:44:04 -0400
committerJune McEnroe <june@causal.agency>2020-04-10 16:44:04 -0400
commit4e0840f8485a6f52ecd316159e22429726b90725 (patch)
tree1b025cdcc2980f2b4fa26634a69ae6b06a50e84f /export.c
parentParse envelope and find thread in concatData (diff)
downloadbubger-4e0840f8485a6f52ecd316159e22429726b90725.tar.gz
bubger-4e0840f8485a6f52ecd316159e22429726b90725.zip
Concatenate mbox threads
Diffstat (limited to '')
-rw-r--r--export.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/export.c b/export.c
index d6c7260..3e0933d 100644
--- a/export.c
+++ b/export.c
@@ -38,19 +38,9 @@ static const char *messagePath(const char *messageID, const char *type) {
 	return buf;
 }
 
-static void flatten(struct List *flat, struct List nested) {
-	for (size_t i = 0; i < nested.len; ++i) {
-		if (nested.ptr[i].type == List) {
-			flatten(flat, nested.ptr[i].list);
-		} else {
-			listPush(flat, nested.ptr[i]);
-		}
-	}
-}
-
 bool exportFetch(FILE *imap, enum Atom tag, struct List threads) {
 	struct List uids = {0};
-	flatten(&uids, threads);
+	listFlatten(&uids, threads);
 	for (size_t i = uids.len - 1; i < uids.len; --i) {
 		uint32_t uid = dataCheck(uids.ptr[i], Number).number;
 		int error = 0