From 81af5c600aa96b1451966e2320088a22804e4ed9 Mon Sep 17 00:00:00 2001 From: Alexandre Morignot <erdnaxeli@cervoi.se> Date: Thu, 19 Feb 2015 12:59:20 +0100 Subject: [PATCH] remove useless code --- Sam/commands/add.pm | 1 - Sam/commands/edit.pm | 9 --------- Sam/commands/list.pm | 2 -- Sam/commands/parser.pm | 3 --- 4 files changed, 15 deletions(-) diff --git a/Sam/commands/add.pm b/Sam/commands/add.pm index bef7466..f5ab623 100644 --- a/Sam/commands/add.pm +++ b/Sam/commands/add.pm @@ -8,7 +8,6 @@ use Sam::Chan; use Sam::Event; use Time::Local; -our $dbh; our $log; sub exec { diff --git a/Sam/commands/edit.pm b/Sam/commands/edit.pm index 197f912..60b44c6 100644 --- a/Sam/commands/edit.pm +++ b/Sam/commands/edit.pm @@ -8,18 +8,12 @@ use Regexp::Common qw(URI); use Sam::Chan; use Sam::Event; -our $dbh; our $log; our $irc; sub exec { my ($id, $command, $arg, $chan_name) = @_; - my $saveCommit = $dbh->{AutoCommit}; - my $saveError = $dbh->{RaiseError}; - $dbh->{AutoCommit} = 0; - $dbh->{RaiseError} = 1; - if ($command eq "lien" or $command eq "url" or $command eq "link") { if ($arg !~ /^$RE{URI}{HTTP}{-scheme => qr(https?)}$/) { die "Ce n'est pas une URL valide"; @@ -46,9 +40,6 @@ sub exec { else { die "Commande inconnue"; } - - $dbh->{AutoCommit} = $saveCommit; - $dbh->{RaiseError} = $saveError; } 1; diff --git a/Sam/commands/list.pm b/Sam/commands/list.pm index 610fb14..c953b77 100644 --- a/Sam/commands/list.pm +++ b/Sam/commands/list.pm @@ -9,13 +9,11 @@ require Exporter; our @ISA = qw(Exporter); our @EXPORT_OK = qw(exec); -our $dbh; our $log; our $irc; sub exec { my $chan = shift; - my $sth; my $calendar_id = Sam::Chan->new(name => $chan)->load->calendar_id; my $events = Sam::Event::Manager->get_events( diff --git a/Sam/commands/parser.pm b/Sam/commands/parser.pm index aa67093..3f627b7 100644 --- a/Sam/commands/parser.pm +++ b/Sam/commands/parser.pm @@ -19,10 +19,7 @@ my $lastID; sub setConf { my ($nickNew, $ircNew, $dbh, $log, $lastIDnew) = @_; - $Sam::commands::add::dbh = $dbh; - $Sam::commands::list::dbh = $dbh; $Sam::commands::addUser::dbh = $dbh; - $Sam::commands::edit::dbh = $dbh; $Sam::commands::getUsers::dbh = $dbh; $Sam::commands::add::log = $log; -- GitLab