From 4ee48b3a1592e9f650e1309da0bddff6efef2ce5 Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Tue, 19 Jul 2022 21:44:38 +0430 Subject: exclusing some channels from logging --- irssi-logger/irssi_logger.pl | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'irssi-logger/irssi_logger.pl') diff --git a/irssi-logger/irssi_logger.pl b/irssi-logger/irssi_logger.pl index 0d92013..d0692d1 100644 --- a/irssi-logger/irssi_logger.pl +++ b/irssi-logger/irssi_logger.pl @@ -102,19 +102,23 @@ sub connect_db { sub write_db { my ($nick, $message, $target) = @_; - my @vals; - my $date = strftime("%Y-%m-%d %H:%M:%S", localtime); + if ($target eq "#news" || $target eq "#supersonic" || $target eq "#bookz") { + # dont do anything + } else { + my @vals; + my $date = strftime("%Y-%m-%d %H:%M:%S", localtime); - $dbh = connect_db() unless $dbh; + $dbh = connect_db() unless $dbh; - push(@vals, $date); - push(@vals, $nick); - push(@vals, $message); - push(@vals, $target); + push(@vals, $date); + push(@vals, $nick); + push(@vals, $message); + push(@vals, $target); - defined or $_ = "" for @vals; + defined or $_ = "" for @vals; - $dbh->do($sql, undef, @vals) || Irssi::print("Can't log to DB! " . DBI::errstr); + $dbh->do($sql, undef, @vals) || Irssi::print("Can't log to DB! " . DBI::errstr); + } } sub log_me { -- cgit v1.2.3