diff --git a/public/js/vroom.js b/public/js/vroom.js index e160f43..0eef2d8 100644 --- a/public/js/vroom.js +++ b/public/js/vroom.js @@ -784,6 +784,7 @@ function initVroom(room) { success: function(data){ if (id === peers.local.id){ if (data.role != peers.local.role){ + getRoomInfo(); webrtc.sendToAll('role_change', {}); } peers.local.role = data.role; diff --git a/vroom.pl b/vroom.pl index 50df808..c4a8e1a 100755 --- a/vroom.pl +++ b/vroom.pl @@ -1837,8 +1837,9 @@ any '/api' => sub { # Return just room config elsif ($req->{action} eq 'get_room_conf'){ my $resp = $self->get_room_conf($room); - my $role = $self->get_key_role($token,$room); - if (!$role || $role !~ m/admin|owner$/){ + my $role = $self->get_key_role($token,$room->{name}); + if (!$role || $role !~ m/^admin|owner$/){ + $self->app->log->debug("API Key $token is not admin, nor owner of room " . $room->{name} . ", blanking out sensible data"); $resp->{notif} = {}; } return $self->render(