X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=Misc.pm;h=aad40e3c36aa5f9fcfb1c5a448a87ce55d61145f;hb=b349d82228db72957556f5dc15fda5e103eaf578;hp=74159ac9e3461b421abf763f745951455141758c;hpb=4f1948e0fe10075464732db5cc2168207c00c7aa;p=NDIRC.git diff --git a/Misc.pm b/Misc.pm index 74159ac..aad40e3 100644 --- a/Misc.pm +++ b/Misc.pm @@ -27,7 +27,7 @@ use NDIRC::Context; our @ISA = qw/Exporter/; -our @EXPORT = qw/valuecolor parseCommand/; +our @EXPORT = qw/valuecolor/; sub valuecolor { my $s = $_; @@ -40,38 +40,5 @@ sub valuecolor { return $s; } -sub parseCommand { - my ($msg, $server, $nick, $address, $channel, $disp,$model) = @_; - - my ($p,$command,$args) = ($msg =~ /^([.!~])(\S+)(?: (.+))?/) or return 0; - - return 0 unless $disp->has_command($command,$channel); - - my $reply_string; - given ($p){ - when ('!'){ - $reply_string = "msg $nick "; - } - when ('~'){ - $reply_string = "msg $channel "; - } - default { - $reply_string = "notice $nick "; - } - } - - $address =~ s/.*@(.*)/$1/; - my $c = NDIRC::Context->new({ - host => $address, - nick => $nick, - channel => $channel, - disp => $disp, - model => $model, - server => $server, - reply_string => $reply_string, - }); - - return $disp->run_command($c,$command,$args); -} 1;