Fix promoting peer

master
Daniel Berteaud 10 years ago
parent f80c8e7d97
commit 41d1282e4b
  1. 4
      vroom.pl

@ -1494,7 +1494,7 @@ any '/api' => sub {
# If we just have been promoted to owner # If we just have been promoted to owner
if ($self->session($room->{name})->{role} ne 'owner' && if ($self->session($room->{name})->{role} ne 'owner' &&
$self->get_peer_role({room => $room->{name}, peer_id => $peer_id}) eq 'owner'){ $self->get_peer_role({room => $room->{name}, peer_id => $peer_id}) eq 'owner'){
$self->session($room)->{role} = 'owner'; $self->session($room->{name})->{role} = 'owner';
$self->associate_key_to_room( $self->associate_key_to_room(
room => $room->{name}, room => $room->{name},
key => $self->session('key'), key => $self->session('key'),
@ -1564,7 +1564,7 @@ any '/api' => sub {
# Promote a participant to be owner of a room # Promote a participant to be owner of a room
elsif ($req->{action} eq 'promote_peer'){ elsif ($req->{action} eq 'promote_peer'){
my $peer_id = $req->{param}->{peer_id}; my $peer_id = $req->{param}->{peer_id};
if ($peer_id && $self->promote_peer({room => $room, peer_id => $peer_id})){ if ($peer_id && $self->promote_peer({room => $room->{name}, peer_id => $peer_id})){
return $self->render( return $self->render(
json => { json => {
status => 'success', status => 'success',

Loading…
Cancel
Save