Don't check if modifying persistence is allowed if not needed

This commit is contained in:
Daniel Berteaud 2015-06-19 14:58:32 +02:00
parent 98439ac100
commit 53975723bd
1 changed files with 1 additions and 1 deletions

View File

@ -1593,7 +1593,7 @@ any '/api' => sub {
$room->{ask_for_name} = ($req->{param}->{ask_for_name}) ? '1' : '0';
$room->{max_members} = $req->{param}->{max_members};
# Room persistence can only be set by admins
if ($self->key_can_do_this(token => $token, action => 'set_persistent') && $req->{param}->{persistent} ne ''){
if ($req->{param}->{persistent} ne '' && $self->key_can_do_this(token => $token, action => 'set_persistent')){
$room->{persistent} = ($req->{param}->{persistent} eq Mojo::JSON->true) ? '1' : '0';
}
foreach my $pass (qw/join_password owner_password/){