From 3c0fd60be530b212042159410dcf9474221a1f19 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Fri, 13 Jun 2014 19:03:26 +0200 Subject: [PATCH] Also create etherpad group on room creation --- public/vroom.pl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/public/vroom.pl b/public/vroom.pl index bfd1c06..05736e1 100755 --- a/public/vroom.pl +++ b/public/vroom.pl @@ -200,6 +200,15 @@ helper create_room => sub { my $tp = $self->get_random(49); $sth->execute($name,time(),time(),$owner,$tp,$config->{realm}) || return undef; $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; };