Support for smart_chat added.
This commit is contained in:
parent
da66fd0654
commit
e0af191eb7
28
init.lua
28
init.lua
@ -21,11 +21,31 @@ yl_matterbridge.information.name = "yl_matterbridge"
|
||||
yl_matterbridge.information.additional = "Additional information"
|
||||
|
||||
-- API
|
||||
-- Overwrite this function to grab the
|
||||
-- Overwrite this function to grab the
|
||||
|
||||
function yl_matterbridge.publish_to_chat(username,text)
|
||||
core.chat_send_all("<"..v.username.."@irc> "..v.text)
|
||||
end
|
||||
if(minetest.global_exists(sc)) then
|
||||
function yl_matterbridge.publish_to_chat(username, text)
|
||||
local all_player = minetest.get_connected_players()
|
||||
for _, player in pairs(all_player) do
|
||||
local pname = players:get_player_name()
|
||||
if(pname ~= username) then -- Don't send to yourself
|
||||
if(channel == nil) then -- Is player in the public channel?
|
||||
minetest.chat_send_player(pname, "<" .. username .. "> " .. text)
|
||||
|
||||
end -- if(channel
|
||||
|
||||
end -- if(pname
|
||||
|
||||
end -- for _,player
|
||||
|
||||
end -- function yl_matterbridge
|
||||
|
||||
else
|
||||
function yl_matterbridge.publish_to_chat(username,text)
|
||||
core.chat_send_all("<"..v.username.."@irc> "..v.text)
|
||||
end
|
||||
|
||||
end -- if(minetest.global_exists(
|
||||
|
||||
local address = minetest.settings:get("yl_matterbridge.address") or false
|
||||
local port = minetest.settings:get("yl_matterbridge.port") or false
|
||||
|
Loading…
Reference in New Issue
Block a user