mirror of
https://github.com/mt-mods/mail.git
synced 2025-07-25 16:44:46 -04:00
Implement non-player recipients (#131)
* Implement non-player recipients * Add API callback specifically for players receiving mail * Exclude sender from (mailing list) recipients * Complement test * Fixup typos in complemented test * Expand aliases at toplevel if the current expansion is at toplevel This should allow players to send mail to their own aliases * Also test on_(player_)receive callbacks * Fix oversight in test case
This commit is contained in:
parent
fcca0b7511
commit
570cf788ec
7 changed files with 185 additions and 64 deletions
|
@ -2,11 +2,11 @@
|
|||
mtt.register("util/normalize_players_and_add_recipients", function(callback)
|
||||
local recipients = {}
|
||||
local undeliverable = {}
|
||||
local to = mail.normalize_players_and_add_recipients("player1,player2", recipients, undeliverable)
|
||||
local to = mail.normalize_players_and_add_recipients("sender", "player1,player2", recipients, undeliverable)
|
||||
|
||||
assert(to == "player1, player2")
|
||||
assert(not next(undeliverable))
|
||||
assert(recipients["player1"])
|
||||
assert(recipients["player2"])
|
||||
callback()
|
||||
end)
|
||||
end)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue