Channel log activated.

This commit is contained in:
A.C.M. 2024-02-10 17:22:44 +01:00
parent 92ac34f105
commit cee42945f8
3 changed files with 31 additions and 5 deletions

View File

@ -16,7 +16,7 @@ sc.public = {}
sc.last_command = nil
sc.version = 1
sc.revision = 6
sc.revision = 7
sc.modname = minetest.get_current_modname()
sc.modpath = minetest.get_modpath(sc.modname)
@ -50,6 +50,7 @@ sc.matterbridge = minetest.settings:get_bool("smart_chat.matterbridge") or false
sc.matterbridge_irc = minetest.settings:get_bool("smart_chat.matterbridge_irc") or false
sc.join_with_priv = minetest.settings:get_bool("smart_chat.join_with_priv") or false
sc.do_not_overwrite_me_command = minetest.settings:get_bool("smart_chat.do_not_overwrite_me_command") or false
sc.log_channels = minetest.settings:get_bool("smart_chat.log_channels") or false
sc.irc_line = ""

30
lib.lua
View File

@ -312,13 +312,29 @@ function lib.chat(playername, text)
minetest.chat_send_player(pname, "<" .. playername .. "> " .. text)
end
minetest.log("verbose", "[MOD] " .. lib.modname .. " : Module lib: chat: <" .. playername .. "> " .. text)
if(lib.log_channels) then
minetest.log("action", "[MOD] " .. lib.modname .. " : Module lib: chat: <" .. playername .. "> " .. text)
else
minetest.log("verbose", "[MOD] " .. lib.modname .. " : Module lib: chat: <" .. playername .. "> " .. text)
end
elseif(lib.check_channel(pname, channel)) then
minetest.chat_send_player(pname, lib.yellow .. "<" .. lib.orange .. playername .. "@"
.. channel .. lib.yellow .. "> " .. text)
minetest.log("verbose", "[MOD] " .. lib.modname .. " : Module lib: chat: <"
.. playername .. "@" .. channel .. "> " .. text)
if(lib.log_channels) then
minetest.log("action", "[MOD] " .. lib.modname .. " : Module lib: chat: <"
.. playername .. "@" .. channel .. "> " .. text)
else
minetest.log("verbose", "[MOD] " .. lib.modname .. " : Module lib: chat: <"
.. playername .. "@" .. channel .. "> " .. text)
end
end -- if(channel == nil
@ -366,7 +382,13 @@ function lib.me(playername, text)
minetest.chat_send_player(pname, me_text)
end
minetest.log("verbose", "[MOD] " .. lib.modname .. " : Module lib: me: " .. text)
if (lib.log_channels) then
minetest.log("action", "[MOD] " .. lib.modname .. " : Module lib: me: " .. text)
else
minetest.log("verbose", "[MOD] " .. lib.modname .. " : Module lib: me: " .. text)
end
elseif(lib.check_channel(pname, channel)) then
minetest.chat_send_player(pname, me_text)

View File

@ -47,6 +47,9 @@ smart_chat.cmd_where (Enable command where) bool true
#Command me
smart_chat.do_not_overwrite_me_command (Overwrite ME to be compatible) bool false
#General
smart_chat.log_channels (Enables the log for all channels) bool false
#IRC-Settings
smart_chat.irc_on (Enable IRC) bool false
smart_chat.host_ip (IP of the IRC) string localhost