* fix for bugs #135 and #136 * Fix indentation in ui/compose.lua Co-authored-by: SX <50966843+S-S-X@users.noreply.github.com> --------- Co-authored-by: Athozus <athozus@gmail.com> Co-authored-by: SX <50966843+S-S-X@users.noreply.github.com>
This commit is contained in:
parent
c5fd218415
commit
fcca0b7511
@ -26,9 +26,7 @@ function mail.show_compose(name, to, subject, body, cc, bcc, id)
|
||||
minetest.formspec_escape(subject) or "",
|
||||
minetest.formspec_escape(body) or "")
|
||||
|
||||
if id then
|
||||
mail.selected_idxs.message[name] = id
|
||||
end
|
||||
mail.selected_idxs.message[name] = id or mail.new_uuid()
|
||||
|
||||
minetest.show_formspec(name, FORMNAME, formspec)
|
||||
end
|
||||
@ -40,10 +38,7 @@ 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 mail.selected_idxs.message[name] then
|
||||
id = mail.selected_idxs.message[name]
|
||||
end
|
||||
local id = mail.selected_idxs.message[name] or mail.new_uuid()
|
||||
if (fields.to == "" and fields.cc == "" and fields.bcc == "") or fields.body == "" then
|
||||
-- if mail is invalid then store it as a draft
|
||||
mail.save_draft({
|
||||
|
@ -59,7 +59,6 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
desc = fields.desc,
|
||||
players = mail.parse_player_list(fields.players)
|
||||
}, old_maillist.name)
|
||||
maillists[mail.selected_idxs.maillists[name]] = nil
|
||||
end
|
||||
else
|
||||
mail.update_maillist(name, {
|
||||
|
Loading…
Reference in New Issue
Block a user