From 79efea7ad5ffa571d27321243e25c372ab4303b2 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Mon, 13 Apr 2020 11:47:36 -0400 Subject: Rename atom rendering functions Again, probably. --- export.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'export.c') diff --git a/export.c b/export.c index 411b70c..8e97370 100644 --- a/export.c +++ b/export.c @@ -71,8 +71,8 @@ static void exportEnvelope(uint32_t uid, const struct Envelope *envelope) { file = fopen(pathUID(path, uid, "atom"), "w"); if (!file) err(EX_CANTCREAT, "%s", path); error = 0 - || atomEntryHead(file, envelope) - || atomEntryTail(file) + || atomEntryOpen(file, envelope) + || atomEntryClose(file) || fclose(file); if (error) err(EX_IOERR, "%s", path); } @@ -98,6 +98,12 @@ static void exportRaw( if (error) err(EX_CANTCREAT, "%s", dst); } +static void exportBodyPart( + uint32_t uid, const struct BodyPart *structure, + const struct BodyPart *part, const char *content +) { +} + bool exportData(FILE *imap, enum Atom tag, struct List items) { uint32_t uid = 0; struct Envelope envelope = {0}; @@ -145,6 +151,12 @@ bool exportData(FILE *imap, enum Atom tag, struct List items) { exportRaw(uid, &envelope, header, body); exportEnvelope(uid, &envelope); + if (structure.multipart) { + // TODO: FETCH each body part. + } else { + exportBodyPart(uid, &structure, &structure, body); + } + envelopeFree(envelope); bodyPartFree(structure); return false; -- cgit 1.4.1