570cf788ec
* 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
13 lines
408 B
Lua
13 lines
408 B
Lua
|
|
mtt.register("util/normalize_players_and_add_recipients", function(callback)
|
|
local recipients = {}
|
|
local 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)
|