Support for smart_chat added. #1

Merged
AliasAlreadyTaken merged 1 commits from :master into master 2022-02-25 20:16:08 +01:00
2 changed files with 27 additions and 4 deletions

View File

@ -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

3
mod.conf Normal file
View File

@ -0,0 +1,3 @@
name = yl_matterbridge
author = AliasAlreadyTaken
optional_dependence = smart_chat