Add drafts

This commit is contained in:
Athozus 2023-03-31 17:04:49 +02:00
parent eae547b2f7
commit a8fc125db3
No known key found for this signature in database
GPG key ID: B50895022E8484BF
9 changed files with 174 additions and 13 deletions

View file

@ -7,6 +7,7 @@ local function populate_entry(e)
e.contacts = e.contacts or {}
e.inbox = e.inbox or {}
e.outbox = e.outbox or {}
e.drafts = e.drafts or {}
e.lists = e.lists or {}
return e
end
@ -83,6 +84,13 @@ function mail.delete_mail(playername, msg_id)
return
end
end
for i, msg in ipairs(entry.drafts) do
if msg.id == msg_id then
table.remove(entry.drafts, i)
mail.set_storage_entry(playername, entry)
return
end
end
end
-- add or update a contact