mirror of
https://github.com/mt-mods/mail.git
synced 2025-07-08 07:30:34 -04:00
Significantly improve maillist behaviour
Replace maillist by its players when sending a message List of players separated by , Avoid doublons when editing more than 2 times a maillist
This commit is contained in:
parent
1e6e06e56f
commit
c4dd235782
4 changed files with 36 additions and 61 deletions
|
@ -7,14 +7,10 @@ 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 _, recipient_name in ipairs(order) do
|
||||
if recipient_name:split("@")[1] == "" then -- in case of maillist
|
||||
if not minetest.player_exists(recipient_name) then
|
||||
undeliverable[recipient_name] = true
|
||||
else
|
||||
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