Add name to report messages

This commit is contained in:
rubenwardy 2018-03-30 13:00:26 +01:00
parent 89e831c5c4
commit 5b5d970fe9

View file

@ -71,16 +71,16 @@ minetest.register_chatcommand("report", {
-- Build message for offline listeners -- Build message for offline listeners
local msg local msg
if #mods == 0 then if #mods == 0 then
msg = "Report: " .. param .. " (no mods online)" msg = "Report from " ..name .. ": " .. param .. " (no mods online)"
else else
msg = "Report: " .. param .. " (mods online: " .. msg = "Report from " ..name .. ": " .. param .. " (mods online: " ..
table.concat(mods, ", ") .. ")" table.concat(mods, ", ") .. ")"
end end
-- Send to IRC moderators -- Send to IRC moderators
for _, name in pairs(get_irc_mods()) do for _, toname in pairs(get_irc_mods()) do
if not minetest.get_player_by_name(name) then if not minetest.get_player_by_name(toname) then
minetest.chat_send_player(name, msg) minetest.chat_send_player(toname, msg)
end end
end end