mirror of
https://github.com/mt-mods/mail.git
synced 2025-07-05 06:00:29 -04:00
parent
0ea3777b51
commit
4d4fd90eee
3 changed files with 23 additions and 12 deletions
|
@ -1,5 +1,5 @@
|
|||
local FORMNAME = "mail:compose"
|
||||
local msg_id = nil
|
||||
local msg_id = {}
|
||||
|
||||
function mail.show_compose(name, to, subject, body, cc, bcc, id)
|
||||
local formspec = [[
|
||||
|
@ -25,7 +25,7 @@ function mail.show_compose(name, to, subject, body, cc, bcc, id)
|
|||
minetest.formspec_escape(body) or "")
|
||||
|
||||
if id then
|
||||
msg_id = id
|
||||
msg_id[name] = id
|
||||
end
|
||||
|
||||
minetest.show_formspec(name, FORMNAME, formspec)
|
||||
|
@ -39,8 +39,8 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
|||
local name = player:get_player_name()
|
||||
if fields.send then
|
||||
local id = mail.new_uuid()
|
||||
if msg_id then
|
||||
id = msg_id
|
||||
if msg_id[name] then
|
||||
id = msg_id[name]
|
||||
end
|
||||
local success, err = mail.send({
|
||||
id = id,
|
||||
|
@ -97,8 +97,8 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
|||
|
||||
elseif fields.draft then
|
||||
local id = mail.new_uuid()
|
||||
if msg_id then
|
||||
id = msg_id
|
||||
if msg_id[name] then
|
||||
id = msg_id[name]
|
||||
end
|
||||
mail.save_draft({
|
||||
id = id,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue