mail/init.lua
y5nw 570cf788ec
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
2024-02-01 20:46:26 +01:00

66 lines
1.2 KiB
Lua

mail = {
-- version
version = 3,
-- mod storage
storage = minetest.get_mod_storage(),
-- ui theme prepend
theme = "",
-- ui forms
ui = {},
-- per-user ephemeral data
selected_idxs = {
inbox = {},
outbox = {},
drafts = {},
trash = {},
message = {},
contacts = {},
maillists = {},
to = {},
cc = {},
bcc = {},
boxtab = {},
sortfield = {},
sortdirection = {},
filter = {},
multipleselection = {},
optionstab = {},
settings_group = {},
},
message_drafts = {}
}
if minetest.get_modpath("default") then
mail.theme = default.gui_bg .. default.gui_bg_img
end
-- sub files
local MP = minetest.get_modpath(minetest.get_current_modname())
dofile(MP .. "/util/init.lua")
dofile(MP .. "/chatcommands.lua")
dofile(MP .. "/migrate.lua")
dofile(MP .. "/hud.lua")
dofile(MP .. "/storage.lua")
dofile(MP .. "/api.lua")
dofile(MP .. "/gui.lua")
dofile(MP .. "/onjoin.lua")
dofile(MP .. "/player_recipients.lua")
-- sub directories
dofile(MP .. "/ui/init.lua")
-- migrate storage
mail.migrate()
if minetest.get_modpath("mtt") then
dofile(MP .. "/mtt.lua")
dofile(MP .. "/api.spec.lua")
dofile(MP .. "/migrate.spec.lua")
dofile(MP .. "/util/uuid.spec.lua")
dofile(MP .. "/util/normalize.spec.lua")
end