Also create etherpad group on room creation

master
Daniel Berteaud 11 years ago
parent e000bf6ccf
commit 3c0fd60be5
  1. 9
      public/vroom.pl

@ -200,6 +200,15 @@ helper create_room => sub {
my $tp = $self->get_random(49); my $tp = $self->get_random(49);
$sth->execute($name,time(),time(),$owner,$tp,$config->{realm}) || return undef; $sth->execute($name,time(),time(),$owner,$tp,$config->{realm}) || return undef;
$self->app->log->info("Room $name created by " . $self->session('name')); $self->app->log->info("Room $name created by " . $self->session('name'));
# therpad integration ?
if ($ec){
my $group = $ec->create_group() || undef;
return undef unless ($group);
$sth = eval { $self->db->prepare("UPDATE `rooms` SET `etherpad_group`=? WHERE `name`='$name';") } || return undef;
$sth->execute($group);
$ec->create_group_pad($group,$name) || return undef;
$self->app->log->debug("Etherpad group $group created for room $name");
}
return 1; return 1;
}; };

Loading…
Cancel
Save