X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=src%2FIRC%2FIrcHooks.pl;h=bcb6fcabe9146d4da5f50e0cae074ebc49b667fd;hb=de9ba421b308e658a84413cd17ddaedf8fead5a1;hp=b143653df407e369d39fc4da8a43b4c66cf3db99;hpb=88bafa062506d1cbc03c8fb2f4d44759c85fe7a0;p=infobot.git diff --git a/src/IRC/IrcHooks.pl b/src/IRC/IrcHooks.pl index b143653..bcb6fca 100644 --- a/src/IRC/IrcHooks.pl +++ b/src/IRC/IrcHooks.pl @@ -150,7 +150,7 @@ sub on_ison { &DEBUG("on_ison: x1 = '$x1', x2 => '$x2'"); } -sub on_endofmotd { +sub on_connected { $conn = shift(@_); # update IRCStats. @@ -170,12 +170,9 @@ sub on_endofmotd { if ( scalar keys %users < 2 ) { &status( '!' x 40 ); - &status( -"!!! Ok. Now type '/msg $ident PASS ' to get master access through DCC CHAT." - ); + &status("!!! Ok. Now type '/msg $ident PASS ' to get master access through DCC CHAT."); &status( '!' x 40 ); } - # end of first time run. if ( &IsChanConf('Wingate') > 0 ) { @@ -213,12 +210,10 @@ sub on_endofmotd { # Q, as on quakenet.org. if ( &IsParam('Q_pass') ) { &status('Authing to Q...'); - &rawout( -"PRIVMSG Q\@CServe.quakenet.org :AUTH $param{'Q_user'} $param{'Q_pass'}" - ); + &rawout("PRIVMSG Q\@CServe.quakenet.org :AUTH $param{'Q_user'} $param{'Q_pass'}"); } - &status('End of motd. Now lets join some channels...'); + &status("$ident End of motd. Now lets join some channels..."); #&joinNextChan(); } @@ -468,8 +463,10 @@ sub on_endofnames { &chanServCheck($chan); + # FIXME: scheduler is b0rken! flood join for now # schedule used to solve ircu (OPN) 'target too fast' problems. - $conn->schedule( 5, sub { &joinNextChan(); } ); + #$conn->schedule( 5, sub { &joinNextChan(); } ); + &joinNextChan(); } sub on_init { @@ -625,7 +622,8 @@ sub on_join { ### ROOTWARN: &rootWarn( $who, $user, $host, $chan ) if ( &IsChanConf('RootWarn') > 0 - && $user =~ /^~?r(oo|ew|00)t$/i ); + && $user eq 'root' ); + #&& $user =~ /^~?r(oo|ew|00)t$/i ); ### emit a message based on who just joined &onjoin( $who, $user, $host, $chan ) if ( &IsChanConf('OnJoin') > 0 ); @@ -816,24 +814,25 @@ sub on_notice { my $nick = $event->nick(); my $chan = ( $event->to )[0]; my $args = ( $event->args )[0]; + my $mynick = $conn->nick(); if ( $nick =~ /^NickServ$/i ) { # nickserv. - &status("NickServ: <== '$args'"); + &status("NickServ: $mynick <== '$args'"); my $check = 0; $check++ if ( $args =~ /^This nickname is registered/i ); $check++ if ( $args =~ /nickname.*owned/i ); if ($check) { - &status('nickserv told us to register; doing it.'); + &status("nickserv told $mynick to register; doing it."); if ( &IsParam('nickServ_pass') ) { - &status('NickServ: ==> Identifying.'); + &status("NickServ: ==> Identifying as $mynick."); &rawout("PRIVMSG NickServ :IDENTIFY $param{'nickServ_pass'}"); return; } else { - &status("We can't tell nickserv a passwd ;("); + &status("$mynick can't tell nickserv a passwd ;("); } } @@ -844,8 +843,7 @@ sub on_notice { foreach ( &ChanConfList('chanServ_ops') ) { next unless &chanServCheck($_); next if ($done); - &DEBUG( - 'nickserv activated or restarted; doing chanserv check.'); + &DEBUG('nickserv activated or restarted; doing chanserv check.'); $done++; } @@ -1092,7 +1090,7 @@ sub on_quit { # revert to main nick. Note that Net::IRC only knows our main nick if ( $nick eq $conn->nick() ) { &status("nickchange: own nick \"$nick\" became free; changing."); - &nick($mynick); + &nick($nick); } } @@ -1332,8 +1330,8 @@ sub on_chanfull { my ($event) = @_; my @args = $event->args; - &status(">>> chanfull/$b_blue$args[1]$ob"); - + &status(">>> chanfull/$b_blue$args[1]$ob, removing autojoin"); + delete $chanconf{$chan}{autojoin}; &joinNextChan(); } @@ -1341,9 +1339,10 @@ sub on_inviteonly { $conn = shift(@_); my ($event) = @_; my @args = $event->args; + my $chan = $args[1]; - &status(">>> inviteonly/$b_cyan$args[1]$ob"); - + &status(">>> inviteonly/$b_cyan$chan$ob, removing autojoin"); + delete $chanconf{$chan}{autojoin}; &joinNextChan(); }