Cleaned up `storeMessage` in mail.d
This commit is contained in:
parent
3929c50aa4
commit
5caa99c06f
2
dub.json
2
dub.json
|
@ -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",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"fileVersion": 1,
|
||||
"versions": {
|
||||
"bformat": "1.0.7"
|
||||
"bformat": "1.0.8"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue