From 15f06dc6f79d4642f41f93231d752e6e2e79ccaf Mon Sep 17 00:00:00 2001 From: William Heimbigner Date: Sat, 31 May 2014 16:47:24 +0400 Subject: Tweaks to commands, better nickspam detection --- config-default/commands.xml | 27 ++++++++++++++++++++++----- modules/classes.pl | 2 +- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/config-default/commands.xml b/config-default/commands.xml index a36ba60..8ef69b4 100644 --- a/config-default/commands.xml +++ b/config-default/commands.xml @@ -1,4 +1,20 @@ + + {channel}}) { + if (defined($::channels->{channel}->{$chan}->{msgs})) { + foreach my $risk (keys %{$::channels->{channel}->{$chan}->{msgs}}) { + push @chans, @{$::channels->{channel}->{$chan}->{msgs}->{$risk}}; + } + } + } + my %uniq = (); + foreach my $chan (@chans) { $uniq{$chan} = 1; } + @chans = keys(%uniq); + print Dumper(\@chans); + ]]> + {gecos} ~~ $::mysql->{ignoredgecos}) ? '' : '&gecos=' . uri_escape($person->{gecos})) . $dq . ' )'); ]]> - + privmsg($event->replyto, "I'm assuming you mean " . $nick . "'s nickserv account, " . lc $::sn{$nick}->{account} . '.'); $nick = lc $::sn{$nick}->{account}; } + my $sayNick = substr($nick, 0, 1) . "\x02\x02" . substr($nick, 1); if (defined($::users->{person}->{$nick}->{flags})) { - $conn->privmsg($event->replyto, "Flags for $nick: $::users->{person}->{$nick}->{flags}"); + $conn->privmsg($event->replyto, "Flags for $sayNick: $::users->{person}->{$nick}->{flags}"); } else { - $conn->privmsg($event->replyto, "$nick has no flags"); + $conn->privmsg($event->replyto, "$sayNick has no flags"); } ]]> @@ -581,8 +598,8 @@ "\x02($event->{nick} plugin)\x02 - ${reason}; ping "; $txtz = $txtz . ASM::Util->commaAndify(ASM::Util->getAlert(lc $chan, $risk, 'hilights')) if (ASM::Util->getAlert(lc $chan, $risk, 'hilights')); $txtz = $txtz . ' !att-' . $chan . '-' . $risk; - my @tgts = ASM::Util->getAlert($chan, $risk, 'msgs'); - ASM::Util->sendLongMsg(\@tgts, $txtz); + my @tgts = ASM::Util->getAlert(lc $chan, $risk, 'msgs'); + ASM::Util->sendLongMsg($conn, \@tgts, $txtz); ]]> diff --git a/modules/classes.pl b/modules/classes.pl index 5cafdbd..2d580b3 100644 --- a/modules/classes.pl +++ b/modules/classes.pl @@ -271,7 +271,7 @@ sub nickspam { if ( length $event->{args}->[0] >= int($cut[0]) ) { my %users = %{$::sc{lc $chan}->{users}}; my %x = map { $_=>$_ } keys %users; - my @uniq = grep( $x{$_}, split( /[ ,]+/ , lc $event->{args}->[0]) ); + my @uniq = grep( $x{$_}, split( /[^a-zA-Z0-9_\\|`[\]{}^-]+/ , lc $event->{args}->[0]) ); return 1 if ( @uniq >= int($cut[1]) ); } return 0; -- cgit v1.2.3