Experimental account_name to tell where people chat from
This commit is contained in:
parent
7072487bc1
commit
a02bcef7ad
8
init.lua
8
init.lua
@ -77,9 +77,9 @@ local function receive()
|
|||||||
if result.succeeded then
|
if result.succeeded then
|
||||||
local data = core.parse_json(result.data)
|
local data = core.parse_json(result.data)
|
||||||
for _, v in ipairs(data) do
|
for _, v in ipairs(data) do
|
||||||
if v.username and v.text then
|
if v.username and v.text and v.account then
|
||||||
core.log("action", "[MOD] yl_matterbridge : Received " .. dump(data))
|
core.log("action", "[MOD] yl_matterbridge : Received " .. dump(data))
|
||||||
yl_matterbridge.receive_from_bridge(v.username, v.text)
|
yl_matterbridge.receive_from_bridge(v.username, v.text, v.account)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -94,8 +94,8 @@ end
|
|||||||
-- Overwrite these function in your chat mod, if you want to govern sending and receveiving yourself
|
-- Overwrite these function in your chat mod, if you want to govern sending and receveiving yourself
|
||||||
-- Don't forget to add an optional dependency to yl_matterbridge
|
-- Don't forget to add an optional dependency to yl_matterbridge
|
||||||
|
|
||||||
function yl_matterbridge.receive_from_bridge(user_name, message_text)
|
function yl_matterbridge.receive_from_bridge(user_name, message_text, account_name)
|
||||||
core.chat_send_all("<<" .. user_name .. ">> " .. message_text)
|
core.chat_send_all("<"..account_name.."|" .. user_name .. "> " .. message_text)
|
||||||
end
|
end
|
||||||
|
|
||||||
function yl_matterbridge.send_to_bridge(user_name, message_text)
|
function yl_matterbridge.send_to_bridge(user_name, message_text)
|
||||||
|
Loading…
Reference in New Issue
Block a user