Cleaned up `storeMessage` in mail.d

This commit is contained in:
Tristan B. Kildaire 2020-06-19 13:22:00 +02:00
parent 3929c50aa4
commit 5caa99c06f
3 changed files with 5 additions and 5 deletions

View File

@ -4,7 +4,7 @@
],
"copyright": "Copyright © 2020, Tristan B. Kildaire",
"dependencies": {
"bformat": "~>1.0.7"
"bformat": "1.0.8"
},
"description": "Butterfly mail daemon",
"license": "AGPL v3",

View File

@ -1,6 +1,6 @@
{
"fileVersion": 1,
"versions": {
"bformat": "1.0.7"
"bformat": "1.0.8"
}
}

View File

@ -89,14 +89,14 @@ public final class Mailbox
public void storeMessage(Folder folder, string mailID, JSONValue mailBlock)
{
/* TODO: Traverse the folder path */
/* Generate the filename to store the message under */
string filename = "mailboxes/"~username~"/"~folder.folderPath~"/"~mailID;
/* Save the message to the file system */
File mailFile;
mailFile.open(filename, "wb");
mailFile.rawWrite(cast(byte[])toJSON(mailBlock));
/* TODO: Store the message in file `filename` */
mailFile.close();
}
public void deleteMessage(Folder folder, string mailID)