From 1f7caf9df18b4fe921ae8a4638d043a65c3e94d1 Mon Sep 17 00:00:00 2001 From: dms Date: Mon, 18 Sep 2000 11:37:51 +0000 Subject: [PATCH] chanserv update to &joinNextChan() git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@111 c11ca15a-4712-0410-83d8-924469b57eb5 --- src/IRC/Irc.pl | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/IRC/Irc.pl b/src/IRC/Irc.pl index f377598..0af89db 100644 --- a/src/IRC/Irc.pl +++ b/src/IRC/Irc.pl @@ -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)."); } @@ -463,6 +465,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"); + } + } } } -- 2.39.5