Use set in lua
This commit is contained in:
parent
76d6dfc263
commit
7c8394f0fd
|
@ -165,6 +165,8 @@ services:
|
||||||
# custom
|
# custom
|
||||||
ports:
|
ports:
|
||||||
- 5280:5280
|
- 5280:5280
|
||||||
|
extra_hosts:
|
||||||
|
- "host.docker.internal:host-gateway"
|
||||||
volumes:
|
volumes:
|
||||||
- ${CONFIG}/prosody/config:/config:Z
|
- ${CONFIG}/prosody/config:/config:Z
|
||||||
- ${CONFIG}/prosody/prosody-plugins-custom:/prosody-plugins-custom:Z
|
- ${CONFIG}/prosody/prosody-plugins-custom:/prosody-plugins-custom:Z
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
sudo chmod 666 jitsi-meet-cfg/prosody/prosody-plugins-custom/mod_jitsi_rooms.lua
|
|
@ -30,7 +30,7 @@ function get_participants_for_room(room_name)
|
||||||
occupants_json:push({
|
occupants_json:push({
|
||||||
jid = tostring(occupant.nick),
|
jid = tostring(occupant.nick),
|
||||||
email = tostring(email),
|
email = tostring(email),
|
||||||
display_name = tostring(nick),
|
displayName = tostring(nick),
|
||||||
avatarURL = tostring(avatarURL)
|
avatarURL = tostring(avatarURL)
|
||||||
});
|
});
|
||||||
end
|
end
|
||||||
|
@ -55,12 +55,16 @@ function get_all_rooms_with_participants()
|
||||||
|
|
||||||
local roomNames = {}
|
local roomNames = {}
|
||||||
for _, v in pairs(actual_rooms) do
|
for _, v in pairs(actual_rooms) do
|
||||||
table.insert(roomNames, v["jitsi_web_query_room"])
|
local roomName = v["jitsi_web_query_room"]
|
||||||
|
if (roomName ~= nil) then
|
||||||
|
roomNames[roomName] = true;
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local rooms_with_participants = {}
|
local rooms_with_participants = array();
|
||||||
for _, room_name in pairs(roomNames) do
|
for room_name, _ in pairs(roomNames) do
|
||||||
rooms_with_participants[room_name] = get_participants_for_room(room_name)
|
local room = { roomName = room_name, participants = get_participants_for_room(room_name) }
|
||||||
|
rooms_with_participants:push(room)
|
||||||
end
|
end
|
||||||
return json.encode(rooms_with_participants)
|
return json.encode(rooms_with_participants)
|
||||||
end
|
end
|
||||||
|
@ -143,7 +147,7 @@ function handle_room_event(event)
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
async_http_request("https://www.toptal.com/developers/postbin/1673793686086-1283829133026",
|
async_http_request("http://192.168.2.116:8081/roomdata",
|
||||||
{
|
{
|
||||||
method = "POST",
|
method = "POST",
|
||||||
body = get_all_rooms_with_participants()
|
body = get_all_rooms_with_participants()
|
||||||
|
|
|
@ -30,7 +30,7 @@ function get_participants_for_room(room_name)
|
||||||
occupants_json:push({
|
occupants_json:push({
|
||||||
jid = tostring(occupant.nick),
|
jid = tostring(occupant.nick),
|
||||||
email = tostring(email),
|
email = tostring(email),
|
||||||
display_name = tostring(nick),
|
displayName = tostring(nick),
|
||||||
avatarURL = tostring(avatarURL)
|
avatarURL = tostring(avatarURL)
|
||||||
});
|
});
|
||||||
end
|
end
|
||||||
|
@ -55,12 +55,16 @@ function get_all_rooms_with_participants()
|
||||||
|
|
||||||
local roomNames = {}
|
local roomNames = {}
|
||||||
for _, v in pairs(actual_rooms) do
|
for _, v in pairs(actual_rooms) do
|
||||||
table.insert(roomNames, v["jitsi_web_query_room"])
|
local roomName = v["jitsi_web_query_room"]
|
||||||
|
if (roomName ~= nil) then
|
||||||
|
roomNames[roomName] = true;
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local rooms_with_participants = {}
|
local rooms_with_participants = array();
|
||||||
for _, room_name in pairs(roomNames) do
|
for room_name, _ in pairs(roomNames) do
|
||||||
rooms_with_participants[room_name] = get_participants_for_room(room_name)
|
local room = { roomName = room_name, participants = get_participants_for_room(room_name) }
|
||||||
|
rooms_with_participants:push(room)
|
||||||
end
|
end
|
||||||
return json.encode(rooms_with_participants)
|
return json.encode(rooms_with_participants)
|
||||||
end
|
end
|
||||||
|
@ -143,7 +147,7 @@ function handle_room_event(event)
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
async_http_request("https://www.toptal.com/developers/postbin/1673793686086-1283829133026",
|
async_http_request("http://192.168.2.116:8081/roomdata",
|
||||||
{
|
{
|
||||||
method = "POST",
|
method = "POST",
|
||||||
body = get_all_rooms_with_participants()
|
body = get_all_rooms_with_participants()
|
||||||
|
|
Loading…
Reference in New Issue