deploy workaround for #84

This commit is contained in:
BuckarooBanzay 2023-05-17 16:16:42 +02:00
parent 8dcfc7dc77
commit 02853fc3d0

View File

@ -45,11 +45,24 @@ function mail.show_message(name, id)
end end
function mail.reply(name, message) function mail.reply(name, message)
if not message then
-- TODO: workaround for https://github.com/mt-mods/mail/issues/84
minetest.log("error", "[mail] reply called with nil message for player: " .. name)
minetest.log("error", "[mail] current mail-context: " .. dump(mail.selected_idxs))
return
end
local replyfooter = "Type your reply here.\n\n--Original message follows--\n" ..message.body local replyfooter = "Type your reply here.\n\n--Original message follows--\n" ..message.body
mail.show_compose(name, message.from, "Re: "..message.subject, replyfooter) mail.show_compose(name, message.from, "Re: "..message.subject, replyfooter)
end end
function mail.replyall(name, message) function mail.replyall(name, message)
if not message then
-- TODO: workaround for https://github.com/mt-mods/mail/issues/84
minetest.log("error", "[mail] replyall called with nil message for player: " .. name)
minetest.log("error", "[mail] current mail-context: " .. dump(mail.selected_idxs))
return
end
local replyfooter = "Type your reply here.\n\n--Original message follows--\n" ..message.body local replyfooter = "Type your reply here.\n\n--Original message follows--\n" ..message.body
-- new recipients are the sender plus the original recipients, minus ourselves -- new recipients are the sender plus the original recipients, minus ourselves