diff options
| -rw-r--r-- | config-default/channels.xml | 77 | ||||
| -rw-r--r-- | modules/event.pl | 111 |
2 files changed, 6 insertions, 182 deletions
diff --git a/config-default/channels.xml b/config-default/channels.xml index 3a44ed6..5bb687e 100644 --- a/config-default/channels.xml +++ b/config-default/channels.xml @@ -1,7 +1,4 @@ <channels> - <channel id="##Thehelpfulone"> - <hilights></hilights> - </channel> <channel id="##asb-debug" monitor="no"> <hilights></hilights> </channel> @@ -29,27 +26,18 @@ </msgs> </channel> <channel id="##hamradio-ops" op="no" /> - <channel id="##javascript"> - <hilights></hilights> - </channel> <channel id="##linux" silence="yes"> <hilights> <disable>ST47</disable> - <low>nalioth</low> <low>denny</low> <low>numist</low> - <low>Fieldy</low> <low>tomaw</low> <low>WildPikachu</low> <low>Gary</low> - <medium>PhilKC</medium> <medium>vorian</medium> <medium>DLange</medium> <medium>pinPoint</medium> <medium>njan</medium> - <medium>linagee</medium> - <opalert>rob</opalert> - <opalert>stew</opalert> </hilights> <msgs> <debug>##linux-ops</debug> @@ -74,26 +62,12 @@ <hilights></hilights> <msgs></msgs> </channel> - <channel id="##thehelpfulone"> - <hilights> - <debug>thehelpfulone</debug> - </hilights> - <msgs> - <debug>##thehelpfulone</debug> - <debug>tho|away</debug> - <disable>##asb-nexus</disable> - </msgs> - </channel> <channel id="##wikia"> <hilights> <debug>charitwo</debug> </hilights> <msgs></msgs> </channel> - <channel id="##wikimedia-ops"> - <hilights></hilights> - <msgs></msgs> - </channel> <channel id="##windows" silence="yes"> <hilights> <debug>jpalmer</debug> @@ -199,9 +173,6 @@ </hilights> <msgs></msgs> </channel> - <channel id="#logbook"> - <hilights></hilights> - </channel> <channel id="#mediawiki" silence="yes"> <hilights> <debug>flyingparchment</debug> @@ -227,20 +198,6 @@ <hilights></hilights> <msgs></msgs> </channel> - <channel id="#sparkfun"> - <hilights></hilights> - </channel> - <channel id="#st47"> - <hilights> - <debug>Randomuser</debug> - <high>Randomuser</high> - <low>Randomuser</low> - </hilights> - <msgs> - <debug>#st47</debug> - <low>#st47</low> - </msgs> - </channel> <channel id="#ubuntu" silence="yes"> <hilights> <debug>nhandler</debug> @@ -253,25 +210,10 @@ <info>#ubuntu-ops-monitor</info> </msgs> </channel> - <channel id="#ubuntu-ops"> - <hilights></hilights> - <msgs></msgs> - </channel> <channel id="#ubuntu-ops-monitor" monitor="no"> <hilights></hilights> <msgs></msgs> </channel> - <channel id="#ubuntu-unregged"> - <hilights></hilights> - <msgs></msgs> - </channel> - <channel id="#wikia"> - <hilights> - <medium>tomaw</medium> - <opalert>AfterDeath</opalert> - </hilights> - <msgs></msgs> - </channel> <channel id="#wikia-dev"> <hilights></hilights> </channel> @@ -326,12 +268,6 @@ <debug>#wikimedia-ops</debug> </msgs> </channel> - <channel id="#wikimedia-ops-internal"> - <hilights> - <debug>AfterDeath</debug> - <debug>Thehelpfulone</debug> - </hilights> - </channel> <channel id="#wikimedia-otrs"> <hilights> <debug>PeterSymonds</debug> @@ -352,7 +288,7 @@ <debug>#wikimedia-ops</debug> </msgs> </channel> - <channel id="#wikimedia-stewards" op="no" /> + <channel id="#wikimedia-stewards" /> <channel id="#wikimedia-tech" silence="yes"> <hilights></hilights> <msgs> @@ -506,20 +442,12 @@ <low>#wikimedia-ops</low> </msgs> </channel> - <channel id="antispammeta"> - <hilights></hilights> - <msgs></msgs> - </channel> - <channel id="default"> - <hilights></hilights> - <msgs></msgs> - </channel> <channel id="master"> <event id="advflood" class="advsplitflood" reason="advanced distributed flooding" risk="debug" type="public,part,caction">5:3</event> <event id="ahbl" class="dnsbl" reason="host $evhost is in dnsbl.ahbl.org ( $xresult )" risk="info" type="join" xresult="Open proxy cat 1">dnsbl.ahbl.org</event> <event id="anontalk1" class="re" reason="anontalk.com spam" risk="medium" type="public">(?i)w(.?)w\1w\1?.\1?a\1n\1o\1n\1t\1a\1l\1k\1?.\1?c\1o\1m</event> <event id="autoremove" class="re" reason="on chanserv autoremove" risk="info" type="part">^requested by ChanServ</event> - <event id="blacklist" class="strbl" reason="sending message containing blacklisted content" risk="low" type="public">blah</event> + <event id="blacklist" class="strbl" reason="sending message containing blacklisted content" risk="low" type="public,part,quit,caction">blah</event> <event id="ctcp-dcc" class="re" reason="ctcp-dcc" risk="high" type="cdcc">.*</event> <event id="ctcp-ping" class="re" reason="channel-wide CTCP PING" risk="medium" type="cping">.*</event> <event id="ctcp-version" class="re" reason="channel-wide CTCP VERSION" risk="medium" type="cversion">.*</event> @@ -548,6 +476,7 @@ <event id="sorbsbl" class="dnsbl" reason="host $evhost is in dnsbl.sorbs.net ( $xresult )" risk="info" type="join">dnsbl.sorbs.net</event> <event id="suckmynick" class="re" reason="using a potentially offensive nick" risk="low" type="join">(suck.*dick)</event> <event id="wikifags2" class="re" reason="saying 'sure are a lot of wikifag'..." risk="low" type="public">(?i)^sure are a ?lot of .*fags? in here</event> + <event id="gnaaquit" class="re" reason="quitting with a GNAA message" risk="medium" type="quit">(?i)\bgnaa\b</event> <hilights> <debug>ST47</debug> <debug>pctony</debug> diff --git a/modules/event.pl b/modules/event.pl index a659461..e7e7d55 100644 --- a/modules/event.pl +++ b/modules/event.pl @@ -55,10 +55,6 @@ sub new $conn->add_handler('cuserinfo', \&on_ctcp); $conn->add_handler('cclientinfo', \&on_ctcp); $conn->add_handler('cfinger', \&on_ctcp); - $conn->add_handler('320', \&whois_identified); - $conn->add_handler('318', \&whois_end); - $conn->add_handler('311', \&whois_user); - $conn->add_handler('352', \&on_whoreply); $conn->add_handler('354', \&on_whoxreply); $conn->add_handler('account', \&on_account); bless($self); @@ -79,8 +75,6 @@ sub on_connect { sub on_join { my ($conn, $event) = @_; - my %evcopyx = %{$event}; - my $evcopy = \%evcopyx; my $nick = lc $event->{nick}; my $chan = lc $event->{to}->[0]; my $rate; @@ -88,14 +82,7 @@ sub on_join { if ( lc $conn->{_nick} eq lc $nick) { $::sc{$chan} = {}; mkdir($::settings->{log}->{dir} . $chan); -# $conn->sl("who $chan"); $conn->sl('who ' . $chan . ' %tcfnuhra,314'); -# I don't know what the hell this was for but I'm disabling it for now -# #TODO: make it settable via config. Hardcoded channames ftl. -# if ($chan eq '##linux') { -# $conn->schedule(300, \&do_chancount, $chan, 300); -# #TODO: mark this as a channel we're watching so we don't schedule this multiple times -# } } $::sc{$chan}{users}{$nick} = {}; $::sc{$chan}{users}{$nick}{hostmask} = $event->{userhost}; @@ -117,19 +104,6 @@ sub on_join { $::sn{$nick}->{user} = $event->{user}; $::sn{$nick}->{host} = $event->{host}; $::sn{$nick}->{account} = lc $event->{args}->[0]; -# if (defined( $::needgeco{$lnick} )) { -# foreach my $event (@{$::needgeco{$lnick}}) { -# $::inspector->inspect($conn, $event); -# $::db->logg( $event ); -# } -# delete $::needgeco{$lnick}; -# if (defined($::needgeco{$nick})) { -# $::needgeco{$nick} = [ @{$::needgeco{$nick}}, $evcopy ]; -# $::db->logg($event); -# } else { -# $::needgeco{$nick} = [ $evcopy ]; -# $conn->sl("whois $nick"); -# } } $::inspector->inspect( $conn, $event ) unless $::netsplit; $::db->logg($event); @@ -167,6 +141,8 @@ sub on_msg { my ($conn, $event) = @_; $::commander->command($conn, $event); + print strftime("%F %T ", gmtime) . "(msg) " . $event->{from} . " - " . $event->{args}->[0] . "\n"; + $conn->privmsg('##asb-nexus', $event->{from} . ' told me: ' . $event->{args}->[0]); } sub on_public @@ -208,7 +184,7 @@ sub on_quit if (($::netsplit == 0) && ($event->{args}->[0] eq "*.net *.split")) { #special, netsplit situation $conn->privmsg("##asb-nexus", "Entering netsplit mode - JOIN and QUIT inspection will be disabled for 60 minutes"); $::netsplit = 1; - $conn->schedule(60*60, sub { $::netsplit = 0; }); + $conn->schedule(60*60, sub { $::netsplit = 0; $conn->privmsg('##asb-nexus', 'Returning to regular operation'); }); } $::inspector->inspect( $conn, $event ) unless $::netsplit; $::log->logg( $event ); @@ -381,46 +357,6 @@ sub on_ctcp_source } } -sub whois_identified { - my ($conn, $event2) = @_; - my $who = lc $event2->{args}->[1]; - if ( (defined( $::idqueue{$who} )) && ( @{$::idqueue{$who}} ) ) { - foreach my $item (@{$::idqueue{$who}}) { - my ($cmd, $command, $event) = @{$item}; - if ( $cmd =~ /$command->{cmd}/ ){ - print strftime("%F %T ", gmtime) . "$event->{from} told me $cmd \n"; - eval $command->{content}; - warn $@ if $@; - } - } - $::idqueue{$who} = []; - } -} - -sub whois_end { - my ($conn, $event) = @_; - my $who = lc $event->{args}->[1]; - $::idqueue{$who} = []; -} - -sub whois_user { - my ($conn, $event2) = @_; - my $lnick = lc $event2->{args}->[1]; - unless (defined($::sn{$lnick})) { - $::sn{$lnick} = {}; - } - $::sn{$lnick}->{gecos} = $event2->{args}->[5]; - $::sn{$lnick}->{user} = $event2->{args}->[2]; - $::sn{$lnick}->{host} = $event2->{args}->[3]; - if (defined( $::needgeco{$lnick} )) { - foreach my $event (@{$::needgeco{$lnick}}) { - $::inspector->inspect($conn, $event); - $::db->logg( $event ); - } - delete $::needgeco{$lnick}; - } -} - sub on_whoxreply { my ($conn, $event) = @_; @@ -446,39 +382,6 @@ sub on_whoxreply $::sc{$chan}{users}{$nick} = {}; $::sc{$chan}{users}{$nick}{op} = $op; $::sc{$chan}{users}{$nick}{voice} = $voice; - -} - -sub on_whoreply -{ - my ($conn, $event) = @_; - my ($tgt, $chan, $user, $host, $server, $nick, $flags, $hops_and_gecos) = @{$event->{args}}; - my ($voice, $op) = (0, 0); - my ($hops, $gecos); - print Dumper($event) if $::debug; - $op = 1 if ( $flags =~ /\@/ ); - $voice = 1 if ($flags =~ /\+/); - if ($hops_and_gecos =~ /^(\d+) (.*)$/) { - $hops = $1; - $gecos = $2; - } else { - $hops = "0"; - $gecos = ""; - } - $::sn{lc $nick} = {} unless defined $::sn{lc $nick}; - my @mship=(); - if (defined($::sn{lc $nick}->{mship})) { - @mship = @{$::sn{lc $nick}->{mship}}; - } - @mship = grep { lc $_ ne lc $chan } @mship; - @mship = (@mship, $chan); - $::sn{lc $nick}->{mship} = \@mship; - $::sn{lc $nick}->{gecos} = $gecos; - $::sn{lc $nick}->{user} = $user; - $::sn{lc $nick}->{host} = $host; - $::sc{lc $chan}{users}{lc $nick} = {}; - $::sc{lc $chan}{users}{lc $nick}{op} = $op; - $::sc{lc $chan}{users}{lc $nick}{voice} = $voice; } sub on_bannedfromchan { @@ -492,12 +395,4 @@ sub on_byechan { #TODO do del event stuff } -sub do_chancount { - my ($conn, $chan, $repeat) = @_; - my @users = keys(%{$::sc{$chan}{users}}); - my $count = @users; - system('/home/icxcnika/AntiSpamMeta/chancount.pl ' . $chan . sprintf(' %d', $count)); - $conn->schedule($repeat, \&do_chancount, $chan, $repeat); -} - return 1; |
