I’m developing a prosody plugin and I need to define the main room. I looked at the BR implementation - useful variables that could help me are made local.
return ;
end
local breakout_rooms_muc_component_config = module:get_option_string('breakout_rooms_muc', 'breakout.'..module.host);
module:depends('jitsi_session');
local breakout_rooms_muc_service;
local main_muc_service;
-- Maps a breakout room jid to the main room jid
local main_rooms_map = {};
-- Utility functions
function get_main_room_jid(room_jid)
local _, host = jid_split(room_jid);
return
host == main_muc_component_config
and room_jid
or main_rooms_map[room_jid];
function get_main_room_jid(room_jid)
local _, host = jid_split(room_jid);
return
host == main_muc_component_config
and room_jid
or main_rooms_map[room_jid];
end
function get_main_room(room_jid)
local main_room_jid = get_main_room_jid(room_jid);
return main_muc_service.get_room_from_jid(main_room_jid), main_room_jid;
end
function get_room_from_jid(room_jid)
local host = jid_host(room_jid);
return
host == main_muc_component_config
How can I define the main room jid (is it possible to hook a message?)
@wfleischer @saghul Can you please take a look? How to get the id of the main room?
Summary
local function sendUserStatus(event)
// get main room jid
end
module:hook(“muc-occupant-joined”, function(event)
sendUserStatus(event)
end, -2);
saghul
December 15, 2022, 9:16am
#3
Note the breakout rooms happen in another MUC, so any room in the main MUC is a main room.
good clue. I modified this component and got what i want
--- Component to trigger an HTTP POST call on room/occupant events
--
-- Example config:
--
-- Component "event_sync.mydomain.com" "event_sync_component"
-- muc_component = "conference.mydomain.com"
-- breakout_component = "breakout.mydomain.com"
--
-- api_prefix = "http://external_app.mydomain.com/api"
--
-- --- The following are all optional
-- include_speaker_stats = true -- if true, total_dominant_speaker_time included in occupant payload
-- api_headers = {
-- ["Authorization"] = "Bearer TOKEN-237958623045";
-- }
-- api_timeout = 10 -- timeout if API does not respond within 10s
-- retry_count = 5 -- retry up to 5 times
-- api_retry_delay = 1 -- wait 1s between retries
-- api_should_retry_for_code = function (code)
-- return code >= 500 or code == 408
This file has been truncated. show original