mirror of
https://github.com/mt-mods/mail.git
synced 2025-03-15 06:01:25 +00:00
* 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
2 changed files with 2 additions and 8 deletions
|
@ -26,9 +26,7 @@ function mail.show_compose(name, to, subject, body, cc, bcc, id)
|
||||||
minetest.formspec_escape(subject) or "",
|
minetest.formspec_escape(subject) or "",
|
||||||
minetest.formspec_escape(body) or "")
|
minetest.formspec_escape(body) or "")
|
||||||
|
|
||||||
if id then
|
mail.selected_idxs.message[name] = id or mail.new_uuid()
|
||||||
mail.selected_idxs.message[name] = id
|
|
||||||
end
|
|
||||||
|
|
||||||
minetest.show_formspec(name, FORMNAME, formspec)
|
minetest.show_formspec(name, FORMNAME, formspec)
|
||||||
end
|
end
|
||||||
|
@ -40,10 +38,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||||
|
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
if fields.send then
|
if fields.send then
|
||||||
local id = mail.new_uuid()
|
local id = mail.selected_idxs.message[name] or mail.new_uuid()
|
||||||
if mail.selected_idxs.message[name] then
|
|
||||||
id = mail.selected_idxs.message[name]
|
|
||||||
end
|
|
||||||
if (fields.to == "" and fields.cc == "" and fields.bcc == "") or fields.body == "" then
|
if (fields.to == "" and fields.cc == "" and fields.bcc == "") or fields.body == "" then
|
||||||
-- if mail is invalid then store it as a draft
|
-- if mail is invalid then store it as a draft
|
||||||
mail.save_draft({
|
mail.save_draft({
|
||||||
|
|
|
@ -59,7 +59,6 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||||
desc = fields.desc,
|
desc = fields.desc,
|
||||||
players = mail.parse_player_list(fields.players)
|
players = mail.parse_player_list(fields.players)
|
||||||
}, old_maillist.name)
|
}, old_maillist.name)
|
||||||
maillists[mail.selected_idxs.maillists[name]] = nil
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
mail.update_maillist(name, {
|
mail.update_maillist(name, {
|
||||||
|
|
Loading…
Add table
Reference in a new issue