diff options
| author | 2015-12-24 23:57:26 +0400 | |
|---|---|---|
| committer | 2015-12-24 23:57:26 +0400 | |
| commit | 82cb57987bcf020f1a54dfe3b6f95790151d76c6 (patch) | |
| tree | 893ab12afc5b408ea46f58b041c3b995148a3622 /lib/ASM | |
| parent | 9ff93cc7e050fbf7117413a17b74a4112b72183d (diff) | |
Add tracking of nickserv account on join database logging
Diffstat (limited to 'lib/ASM')
| -rw-r--r-- | lib/ASM/DB.pm | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/ASM/DB.pm b/lib/ASM/DB.pm index 5ed239b..b842deb 100644 --- a/lib/ASM/DB.pm +++ b/lib/ASM/DB.pm @@ -262,6 +262,9 @@ sub logg if ($table eq 'kick') { $string = $string . ', victim_nick, victim_user, victim_host, victim_geco, content1'; } + if ($table eq 'join') { + $string .= ', account'; + } $string = $string . ') VALUES ('; if (($table ne 'nick') && ($table ne 'quit') && ($table ne 'kick')) { $string = $string . $dbh->quote($event->{to}->[0]) . ", "; @@ -285,8 +288,17 @@ sub logg if ($table eq 'mode') { $string = $string . ', ' . $dbh->quote($event->{args}->[1]); } + if ($table eq 'join') { + my $account = $::sn{lc $event->{nick}}->{account}; + if (!defined($account) or ($account eq '0') or ($account eq '*')) { + $account = 'NULL'; + } else { + $account = $dbh->quote($account); + } + $string .= ', ' . $account; + } $string = $string . ');'; -# ASM::Util->dprint($string, "mysql"); + ASM::Util->dprint($string, 'mysql'); $dbh->do($string); } |
