From: dms Date: Sat, 16 Dec 2000 12:29:36 +0000 (+0000) Subject: - &dccsay() added. X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=e85fc8c46f08bcf702a2b65d51c0ee2598c2ccda;p=infobot.git - &dccsay() added. - &dcc_close() added. - use dccsay in performStrictReply() git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@201 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/src/IRC/Irc.pl b/src/IRC/Irc.pl index 2f3b3b4..8232a22 100644 --- a/src/IRC/Irc.pl +++ b/src/IRC/Irc.pl @@ -202,6 +202,10 @@ sub msg { } $last{msg} = $msg; + if ($msg =~ /\cB/) { + &status("^B hrm."); + } + &status(">$nick< $msg"); $conn->privmsg($nick, $msg) if (&whatInterface() =~ /IRC/); } @@ -301,11 +305,7 @@ sub performStrictReply { } elsif ($msgType eq 'public') { &say($reply); } elsif ($msgType eq 'chat') { - if (!exists $dcc{'CHAT'}{$who}) { - &WARN("pSR: dcc{'CHAT'}{$who} does not exist."); - return; - } - $conn->privmsg($dcc{'CHAT'}{$who}, $reply); + &dccsay($who,$reply); } else { &ERROR("pSR: msgType invalid? ($msgType)."); } @@ -313,6 +313,28 @@ sub performStrictReply { return ''; } +sub dccsay { + my ($who, $reply) = @_; + if (!exists $dcc{'CHAT'}{$who}) { + &WARN("pSR: dcc{'CHAT'}{$who} does not exist."); + return ''; + } + + $conn->privmsg($dcc{'CHAT'}{$who}, $reply); +} + +sub dcc_close { + my($who) = @_; + my $type; + + foreach $type (keys %dcc) { + &FIXME("dcc_close: $who"); + my @who = grep /^\Q$who\E$/i, keys %{$dcc{$type}}; + next unless (scalar @who); + $who = $who[0]; + } +} + sub joinchan { my ($chankey) = @_; my $chan = lc $chankey; @@ -599,10 +621,14 @@ sub makeChanList { } sub closeDCC { + &DEBUG("closeDCC called."); + foreach $type (keys %dcc) { + next if ($type ne uc($type)); + foreach (keys %{$dcc{$type}}) { &DEBUG("closing DCC $type to $_ (FIXME)."); -### $irc->removeconn($dcc{$type}{$_}); + $dcc{$type}{$_}->close(); } } }