From 63521f5e85d20d9aa780cae6ca791486839b2fee Mon Sep 17 00:00:00 2001 From: BuckarooBanzay Date: Tue, 13 Oct 2020 19:15:58 +0200 Subject: [PATCH] check fields of forwarded mail fixes https://github.com/pandorabox-io/pandorabox.io/issues/556 --- gui.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gui.lua b/gui.lua index 576a1d5..933b9ee 100644 --- a/gui.lua +++ b/gui.lua @@ -320,7 +320,7 @@ end function mail.replyall(name, message) mail.ensure_new_format(message) 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 local recipients = message.to or "" if message.sender ~= nil then @@ -334,7 +334,7 @@ function mail.replyall(name, message) end end recipients = mail.concat_player_list(recipients) - + -- new CC is old CC minus ourselves local cc = mail.parse_player_list(message.cc) for k,v in pairs(cc) do @@ -349,8 +349,8 @@ function mail.replyall(name, message) end function mail.forward(name, message) - local fwfooter = "Type your message here.\n\n--Original message follows--\n" ..message.body - mail.show_compose(name, "", "Fw: "..message.subject, fwfooter) + local fwfooter = "Type your message here.\n\n--Original message follows--\n" .. (message.body or "") + mail.show_compose(name, "", "Fw: " .. (message.subject or ""), fwfooter) end function mail.handle_receivefields(player, formname, fields) @@ -390,7 +390,7 @@ function mail.handle_receivefields(player, formname, fields) elseif fields.reply and messages[selected_idxs.messages[name]] then local message = messages[selected_idxs.messages[name]] mail.reply(name, message) - + elseif fields.replyall and messages[selected_idxs.messages[name]] then local message = messages[selected_idxs.messages[name]] mail.replyall(name, message)