Fixes using correct field for domain in multidomain mode.

This commit is contained in:
damencho 2017-07-19 11:36:49 -05:00
parent 4a9a8eec9a
commit f40faecfbe
1 changed files with 10 additions and 3 deletions

View File

@ -13,6 +13,12 @@ local poltergeist_component
-- defaults to 3 min -- defaults to 3 min
local poltergeist_timeout local poltergeist_timeout
= module:get_option_string("poltergeist_leave_timeout", 180); = module:get_option_string("poltergeist_leave_timeout", 180);
-- this basically strips the domain from the conference.domain address
local parentHostName = string.gmatch(tostring(module.host), "%w+.(%w.+)")();
if parentHostName == nil then
log("error", "Failed to start - unable to get parent hostname");
return;
end
-- table to store all poltergeists we create -- table to store all poltergeists we create
local poltergeists = {}; local poltergeists = {};
@ -28,8 +34,9 @@ local poltergeists_pr_ignore = {};
-- @return returns room if found or nil -- @return returns room if found or nil
function get_room(room_name, group) function get_room(room_name, group)
local room_address = jid.join(room_name, module:get_host()); local room_address = jid.join(room_name, module:get_host());
-- if there is a group we are in multidomain mode -- if there is a group we are in multidomain mode and that group is not
if group and group ~= "" then -- our parent host
if group and group ~= "" and group ~= parentHostName then
room_address = "["..group.."]"..room_address; room_address = "["..group.."]"..room_address;
end end
@ -92,7 +99,7 @@ prosody.events.add_handler("pre-jitsi-authentication", function(session)
if (session.jitsi_meet_context_user) then if (session.jitsi_meet_context_user) then
local room = get_room( local room = get_room(
session.jitsi_bosh_query_room, session.jitsi_bosh_query_room,
session.jitsi_meet_context_group); session.jitsi_meet_domain);
if (not room) then if (not room) then
return nil; return nil;