aboutsummaryrefslogtreecommitdiffstats
path: root/irssi-logger
diff options
context:
space:
mode:
authorterminaldweller <thabogre@gmail.com>2022-07-19 17:14:38 +0000
committerterminaldweller <thabogre@gmail.com>2022-07-19 17:14:38 +0000
commit4ee48b3a1592e9f650e1309da0bddff6efef2ce5 (patch)
tree04447dc6a5db1df7318d74355ab328b84e2329b0 /irssi-logger
parentupdate (diff)
downloadirssi-scripts-4ee48b3a1592e9f650e1309da0bddff6efef2ce5.tar.gz
irssi-scripts-4ee48b3a1592e9f650e1309da0bddff6efef2ce5.zip
exclusing some channels from logging
Diffstat (limited to 'irssi-logger')
-rw-r--r--irssi-logger/irssi_logger.pl22
1 files changed, 13 insertions, 9 deletions
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 {