fix for bugs #135 and #136 (#137)

* 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:
Singularis 2024-02-01 13:33:33 +00:00 committed by GitHub
parent c5fd218415
commit fcca0b7511
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 8 deletions

View File

@ -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({

View File

@ -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, {