X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=src%2FIRC%2FIrc.pl;h=d2bc6fae87752903c7713a0c4ed7c8557a7ca40c;hb=6463b250bff603b669fc46d3fda1f1458b44b320;hp=34e99420e9693074dc023d6021c1387734e6ed0c;hpb=bb482ed34735d13cad2a02cf0f5cdc322b6b9f89;p=infobot.git diff --git a/src/IRC/Irc.pl b/src/IRC/Irc.pl index 34e9942..d2bc6fa 100644 --- a/src/IRC/Irc.pl +++ b/src/IRC/Irc.pl @@ -1,6 +1,6 @@ # # Irc.pl: IRC core stuff. -# Author: xk +# Author: dms # Version: 20000126 # NOTE: Based on code by Kevin Lenzo & Patrick Cole (c) 1997 # @@ -160,7 +160,7 @@ sub rawout { sub say { my ($msg) = @_; - if (!defined $msg or $msg eq "NOREPLY") { + if (!defined $msg or $msg eq $noreply) { $msg ||= "NULL"; &DEBUG("say: msg == $msg."); return; @@ -187,7 +187,7 @@ sub msg { return; } - if (!defined $msg or $msg eq "NOREPLY") { + if (!defined $msg or $msg eq $noreply) { $msg ||= "NULL"; &DEBUG("msg: msg == $msg."); return; @@ -271,9 +271,11 @@ sub performReply { } &msg($who, $reply); } elsif ($msgType eq 'chat') { - &DEBUG("pR: chat: reply => '$reply'."); - &DEBUG("pR: chat: sock => '$dcc{'CHAT'}{$nick}'."); - &DEBUG("pR: chat: sock => '$dcc{'CHAT'}{$who}'."); + if (!exists $dcc{'CHAT'}{$who}) { + &WARN("pSR: dcc{'CHAT'}{$who} does not exist."); + return; + } + $conn->privmsg($dcc{'CHAT'}{$who}, $reply); } else { &ERROR("PR: msgType invalid? ($msgType)."); } @@ -352,6 +354,8 @@ sub mode { return; } + &DEBUG("MODE $chan $modes"); + rawout("MODE $chan $modes"); } @@ -463,6 +467,21 @@ sub joinNextChan { if (my $i = scalar @joinchan) { &status("joinNextChan: $i chans to join."); } + } else { + return unless (&IsParam("chanServ_ops")); + if (!$nickserv) { + &DEBUG("jNC: nickserv/chanserv not up?"); + } + + my @chans = split(/[\s\t]+/, $param{'chanServ_ops'}); + foreach $chan (keys %channels) { + next unless (grep /^$chan$/i, @chans); + + if (!exists $channels{$chan}{'o'}{$ident}) { + &status("ChanServ ==> Requesting ops for $chan."); + &rawout("PRIVMSG ChanServ :OP $chan $ident"); + } + } } }