Add ability to choose default status (to/cc/bcc)

Signed-off-by: Athozus <athozus@gmail.com>
This commit is contained in:
Athozus 2023-03-01 18:30:39 +01:00
parent 2656936a6f
commit 698e8617c7
No known key found for this signature in database
GPG key ID: B50895022E8484BF
3 changed files with 6 additions and 5 deletions

View file

@ -196,11 +196,12 @@ function mail.addMaillist(maillist, players_string)
end
table.insert(maillists, 1, maillist)
if mail.write_json_file(mail.maildir .. "/mail.maillists.json", maillists) then
-- add default status for players contained in the maillist
local players = mail.split(players_string,",")
-- add status for players contained in the maillist
local players = mail.split(players_string,"\n")
for _, player in ipairs(players) do
if minetest.player_exists(player) then -- avoid blank names
mail.addPlayerToMaillist(player, maillist.id, "to")
local playerInfo = mail.split(player, " ")
if minetest.player_exists(playerInfo[1]) then -- avoid blank names
mail.addPlayerToMaillist(playerInfo[1], maillist.id, playerInfo[2])
end
end
return true