mirror of
https://github.com/mt-mods/mail.git
synced 2025-07-14 10:21:59 -04:00
Use core namespace instead of minetest
This commit is contained in:
parent
8a992b7a29
commit
030a7a3fe8
29 changed files with 135 additions and 135 deletions
|
@ -12,7 +12,7 @@ function mail.compile_contact_list(name, selected, playernames)
|
|||
if i == 1 then length = l end
|
||||
formspec[#formspec + 1] = ","
|
||||
formspec[#formspec + 1] = ","
|
||||
formspec[#formspec + 1] = minetest.formspec_escape(contact.name)
|
||||
formspec[#formspec + 1] = core.formspec_escape(contact.name)
|
||||
formspec[#formspec + 1] = ","
|
||||
local note = contact.note
|
||||
-- display an ellipsis if the note spans multiple lines
|
||||
|
@ -20,7 +20,7 @@ function mail.compile_contact_list(name, selected, playernames)
|
|||
if idx ~= nil then
|
||||
note = string.sub(note, 1, idx-1) .. ' ...'
|
||||
end
|
||||
formspec[#formspec + 1] = minetest.formspec_escape(note)
|
||||
formspec[#formspec + 1] = core.formspec_escape(note)
|
||||
if type(selected) == "string" then
|
||||
if string.lower(selected) == k then
|
||||
selected = i
|
||||
|
@ -43,7 +43,7 @@ function mail.compile_contact_list(name, selected, playernames)
|
|||
for i,c in ipairs(playernames) do
|
||||
formspec[#formspec + 1] = ","
|
||||
formspec[#formspec + 1] = ","
|
||||
formspec[#formspec + 1] = minetest.formspec_escape(c)
|
||||
formspec[#formspec + 1] = core.formspec_escape(c)
|
||||
formspec[#formspec + 1] = ","
|
||||
if contacts[string.lower(c)] == nil then
|
||||
formspec[#formspec + 1] = ""
|
||||
|
@ -54,7 +54,7 @@ function mail.compile_contact_list(name, selected, playernames)
|
|||
if idx ~= nil then
|
||||
note = string.sub(note, 1, idx-1) .. ' ...'
|
||||
end
|
||||
formspec[#formspec + 1] = minetest.formspec_escape(note)
|
||||
formspec[#formspec + 1] = core.formspec_escape(note)
|
||||
end
|
||||
if not selected then
|
||||
if type(selected) == "string" then
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
-- sub files
|
||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
||||
local MP = core.get_modpath(core.get_current_modname())
|
||||
dofile(MP .. "/util/normalize.lua")
|
||||
dofile(MP .. "/util/colors.lua")
|
||||
dofile(MP .. "/util/contact.lua")
|
||||
|
|
|
@ -74,7 +74,7 @@ end
|
|||
function mail.settings.mute_list.check(name, value)
|
||||
local valid_players = {}
|
||||
for _, p in ipairs(value) do
|
||||
if p ~= name and minetest.player_exists(p) then
|
||||
if p ~= name and core.player_exists(p) then
|
||||
table.insert(valid_players, p)
|
||||
end
|
||||
end
|
||||
|
@ -82,9 +82,9 @@ function mail.settings.mute_list.check(name, value)
|
|||
end
|
||||
|
||||
function mail.settings.mute_list.sync(name)
|
||||
if minetest.get_modpath("beerchat") then
|
||||
if core.get_modpath("beerchat") then
|
||||
local players = {}
|
||||
for other_player, _ in minetest.get_auth_handler().iterate() do
|
||||
for other_player, _ in core.get_auth_handler().iterate() do
|
||||
if beerchat.has_player_muted_player(name, other_player) then
|
||||
table.insert(players, other_player)
|
||||
end
|
||||
|
@ -95,16 +95,16 @@ function mail.settings.mute_list.sync(name)
|
|||
end
|
||||
|
||||
function mail.settings.mute_list.transfer(name, value)
|
||||
if minetest.get_modpath("beerchat") then
|
||||
for other_player, _ in minetest.get_auth_handler().iterate() do -- unmute all
|
||||
if core.get_modpath("beerchat") then
|
||||
for other_player, _ in core.get_auth_handler().iterate() do -- unmute all
|
||||
if not beerchat.execute_callbacks("before_mute", name, other_player) then
|
||||
return false
|
||||
end
|
||||
minetest.get_player_by_name(name):get_meta():set_string(
|
||||
core.get_player_by_name(name):get_meta():set_string(
|
||||
"beerchat:muted:" .. other_player, "")
|
||||
end
|
||||
for _, other_player in ipairs(value) do -- then mute only players in table
|
||||
minetest.get_player_by_name(name):get_meta():set_string(
|
||||
core.get_player_by_name(name):get_meta():set_string(
|
||||
"beerchat:muted:" .. other_player, "true")
|
||||
end
|
||||
return true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue