mirror of
https://github.com/mt-mods/mail.git
synced 2025-07-04 21:50:28 -04:00
Implement drafts (#31)
* Add drafts * Update translations * Fix luacheck * Fix luacheck (2)
This commit is contained in:
parent
eae547b2f7
commit
0ea3777b51
12 changed files with 230 additions and 107 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue