Fix DM beeps w/ new translation

master
Aaron Suen 2022-04-01 13:08:12 -04:00
parent 9664255b3e
commit c09272b39d
1 changed files with 3 additions and 1 deletions

View File

@ -94,11 +94,13 @@ minetest.register_globalstep(function()
pending = {}
end)
local dmtrans = minetest.translate("__builtin", "DM from XXX"):gsub("XXX.*", "")
local function send(pname, text)
text = tostring(text)
local msgtype
if text:match("^%s*DM%sfrom%s") then msgtype = 1 -- DM
if text:match("^%s*DM%sfrom%s") then msgtype = 1 -- DM (old style)
elseif text:sub(1, #dmtrans) == dmtrans then msgtype = 1 -- DM (new style)
elseif text:match("^%s*%<") then
if text:lower():match(">.*" .. pname:lower():gsub("([^%w])", "%%%1")) then
msgtype = 2 -- mention in public chat