Use set in lua
This commit is contained in:
parent
76d6dfc263
commit
7c8394f0fd
4 changed files with 23 additions and 12 deletions
|
@ -30,7 +30,7 @@ function get_participants_for_room(room_name)
|
|||
occupants_json:push({
|
||||
jid = tostring(occupant.nick),
|
||||
email = tostring(email),
|
||||
display_name = tostring(nick),
|
||||
displayName = tostring(nick),
|
||||
avatarURL = tostring(avatarURL)
|
||||
});
|
||||
end
|
||||
|
@ -55,12 +55,16 @@ function get_all_rooms_with_participants()
|
|||
|
||||
local roomNames = {}
|
||||
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
|
||||
|
||||
local rooms_with_participants = {}
|
||||
for _, room_name in pairs(roomNames) do
|
||||
rooms_with_participants[room_name] = get_participants_for_room(room_name)
|
||||
local rooms_with_participants = array();
|
||||
for room_name, _ in pairs(roomNames) do
|
||||
local room = { roomName = room_name, participants = get_participants_for_room(room_name) }
|
||||
rooms_with_participants:push(room)
|
||||
end
|
||||
return json.encode(rooms_with_participants)
|
||||
end
|
||||
|
@ -143,7 +147,7 @@ function handle_room_event(event)
|
|||
return;
|
||||
end
|
||||
|
||||
async_http_request("https://www.toptal.com/developers/postbin/1673793686086-1283829133026",
|
||||
async_http_request("http://192.168.2.116:8081/roomdata",
|
||||
{
|
||||
method = "POST",
|
||||
body = get_all_rooms_with_participants()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue