#
# Irc.pl: IRC core stuff.
-# Author: xk <xk@leguin.openprojects.net>
+# Author: dms
# Version: 20000126
# NOTE: Based on code by Kevin Lenzo & Patrick Cole (c) 1997
#
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;
return;
}
- if (!defined $msg or $msg eq "NOREPLY") {
+ if (!defined $msg or $msg eq $noreply) {
$msg ||= "NULL";
&DEBUG("msg: msg == $msg.");
return;
}
&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).");
}
return;
}
+ &DEBUG("MODE $chan $modes");
+
rawout("MODE $chan $modes");
}
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");
+ }
+ }
}
}