Implement drafts (#31)

* Add drafts

* Update translations

* Fix luacheck

* Fix luacheck (2)
This commit is contained in:
Athozus 2023-03-31 17:14:52 +02:00 committed by GitHub
parent eae547b2f7
commit 0ea3777b51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 230 additions and 107 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