mirror of
https://github.com/mt-mods/mail.git
synced 2025-07-05 14:10:31 -04:00
Add ability to use maillist in messages and receive messages from them
This commit is contained in:
parent
85a5e525be
commit
2443cc5dec
4 changed files with 87 additions and 16 deletions
|
@ -6,11 +6,15 @@ and add individual player names to recipient list
|
|||
--]]
|
||||
function mail.normalize_players_and_add_recipients(field, recipients, undeliverable)
|
||||
local order = mail.parse_player_list(field)
|
||||
for _, player_name in ipairs(order) do
|
||||
if not minetest.player_exists(player_name) then
|
||||
undeliverable[player_name] = true
|
||||
else
|
||||
recipients[player_name] = true
|
||||
for _, recipient_name in ipairs(order) do
|
||||
if mail.split(recipient_name, "@")[1] == "" then -- in case of maillist
|
||||
recipients[recipient_name] = true
|
||||
else -- in case of playerˇ
|
||||
if not minetest.player_exists(recipient_name) then
|
||||
undeliverable[recipient_name] = true
|
||||
else
|
||||
recipients[recipient_name] = true
|
||||
end
|
||||
end
|
||||
end
|
||||
return mail.concat_player_list(order)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue