Adds a second parameter named domain to muc_size module.

Adds and the default conference. part where the muc module live in default deployments.
This commit is contained in:
damencho 2017-04-05 13:41:21 -05:00
parent 19f46ed4f0
commit 4ec4c45a90
1 changed files with 8 additions and 4 deletions

View File

@ -40,10 +40,12 @@ end
function handle_get_room_size(event) function handle_get_room_size(event)
local params = parse(event.request.url.query); local params = parse(event.request.url.query);
local room_name = params["room"]; local room_name = params["room"];
local room = get_room_from_jid(room_name); local domain_name = params["domain"];
local room_address = room_name .. "@" .. "conference." .. domain_name;
local room = get_room_from_jid(room_address);
local participant_count = 0; local participant_count = 0;
log("debug", "Querying room %s", tostring(room_name)); log("debug", "Querying room %s", tostring(room_address));
if room then if room then
local occupants = room._occupants; local occupants = room._occupants;
@ -71,11 +73,13 @@ end
function handle_get_room (event) function handle_get_room (event)
local params = parse(event.request.url.query); local params = parse(event.request.url.query);
local room_name = params["room"]; local room_name = params["room"];
local room = get_room_from_jid(room_name); local domain_name = params["domain"];
local room_address = room_name .. "@" .. "conference." .. domain_name;
local room = get_room_from_jid(room_address);
local participant_count = 0; local participant_count = 0;
local occupants_json = array(); local occupants_json = array();
log("debug", "Querying room %s", tostring(room_name)); log("debug", "Querying room %s", tostring(room_address));
if room then if room then
local occupants = room._occupants; local occupants = room._occupants;