add optional function param with alternative gateway
util as api to mods that want use an alternative gateway to send msgs
This commit is contained in:
parent
f44729462a
commit
6ae8ccda85
8
init.lua
8
init.lua
@ -50,7 +50,7 @@ end
|
||||
local url_send = "http://" .. settings.address .. ":" .. settings.port .. "/api/message"
|
||||
local url_receive = "http://" .. settings.address .. ":" .. settings.port .. "/api/messages"
|
||||
|
||||
local function send(user_name, message_text)
|
||||
local function send(user_name, message_text, gateway)
|
||||
if yl_matterbridge.enabled == false then
|
||||
return false
|
||||
end
|
||||
@ -62,7 +62,7 @@ local function send(user_name, message_text)
|
||||
local data_in = {
|
||||
text = message_text,
|
||||
username = user_name,
|
||||
gateway = settings.gateway
|
||||
gateway = gateway or settings.gateway
|
||||
}
|
||||
|
||||
http.fetch({
|
||||
@ -153,8 +153,8 @@ end
|
||||
|
||||
-- Call this function to feed into the bridge from your own mod, if you unset yl_matterbridge.chat_message
|
||||
|
||||
function yl_matterbridge.send_to_bridge(user_name, message_text)
|
||||
send(user_name, message_text)
|
||||
function yl_matterbridge.send_to_bridge(user_name, message_text, gateway)
|
||||
send(user_name, message_text, gateway)
|
||||
end
|
||||
|
||||
-- Set this function to yl_matterbridge.chat_message = function() end
|
||||
|
Loading…
Reference in New Issue
Block a user