|
|
@ -1290,11 +1290,16 @@ any '/api' => sub { |
|
|
|
# Here are method not tied to a room |
|
|
|
# Here are method not tied to a room |
|
|
|
if ($req->{action} eq 'get_room_list'){ |
|
|
|
if ($req->{action} eq 'get_room_list'){ |
|
|
|
my $rooms = $self->get_room_list; |
|
|
|
my $rooms = $self->get_room_list; |
|
|
|
# Blank out a few param we don't need |
|
|
|
|
|
|
|
foreach my $r (keys %{$rooms}){ |
|
|
|
foreach my $r (keys %{$rooms}){ |
|
|
|
|
|
|
|
# Blank out a few param we don't need |
|
|
|
foreach my $p (qw/join_password owner_password owner token etherpad_group/){ |
|
|
|
foreach my $p (qw/join_password owner_password owner token etherpad_group/){ |
|
|
|
delete $rooms->{$r}->{$p}; |
|
|
|
delete $rooms->{$r}->{$p}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
# Count active users |
|
|
|
|
|
|
|
$rooms->{$r}->{members} = 0; |
|
|
|
|
|
|
|
foreach my $peer (keys %$peers){ |
|
|
|
|
|
|
|
$rooms->{$r}->{members}++ if ($peers->{$peer}->{room} eq $r); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return $self->render( |
|
|
|
return $self->render( |
|
|
|
json => { |
|
|
|
json => { |
|
|
|