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:
Athozus 2023-03-24 19:47:19 +01:00
parent 1e6e06e56f
commit c4dd235782
No known key found for this signature in database
GPG key ID: B50895022E8484BF
4 changed files with 36 additions and 61 deletions

View file

@ -47,11 +47,14 @@ function mail.send(...)
-- normalize to, cc and bcc while compiling a list of all recipients
local recipients = {}
local undeliverable = {}
m.to = mail.concat_player_list(mail.extractMaillists(m.to, m.from))
m.to = mail.normalize_players_and_add_recipients(m.to, recipients, undeliverable)
if m.cc then
m.cc = mail.concat_player_list(mail.extractMaillists(m.cc, m.from))
m.cc = mail.normalize_players_and_add_recipients(m.cc, recipients, undeliverable)
end
if m.bcc then
m.bcc = mail.concat_player_list(mail.extractMaillists(m.bcc, m.from))
m.bcc = mail.normalize_players_and_add_recipients(m.bcc, recipients, undeliverable)
end