Module 如何在不重新启动韵律服务器的情况下添加muc组件
在不重新启动韵律服务器的情况下添加muc组件 完成以下代码,然后尝试使用RESTAPI执行它。 但muc组件无法加载Module 如何在不重新启动韵律服务器的情况下添加muc组件,module,configuration,lua,multiuserchat,prosody-im,Module,Configuration,Lua,Multiuserchat,Prosody Im,在不重新启动韵律服务器的情况下添加muc组件 完成以下代码,然后尝试使用RESTAPI执行它。 但muc组件无法加载 --------------code begin--------------- localh hm = require "core.hostmanager"; local mm = require "core.modulemanager"; host= "muc.example.co"; hm.activate(host); local key= "component_modu
--------------code begin---------------
localh hm = require "core.hostmanager";
local mm = require "core.modulemanager";
host= "muc.example.co";
hm.activate(host);
local key= "component_module";
local value = "muc";
cmg._M.set(host, key, value);
mm.load_modules_for_host(host);
-----code end-----------------
如何在不重新加载韵律服务器的情况下启用muc服务点。使用下面的代码,我们可以实现它
local muc_host= "test.example.com"
local hm = require "core.hostmanager";
local cmg = require "core.configmanager";
local append_text= 'Component "'..muc_host..'" "muc" \n'
--appending the text to config file
local file_name="/etc/prosody/prosody.cfg.lua"
file = io.open(file_name, "a")
file:write(append_text)
file:close()
-- load & activate new muc server
local lstatus=cmg.load(file_name)
local new_server_status = hm.activate(muc_host)
mm.load_modules_for_host(host)