X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=Misc.pm;h=aad40e3c36aa5f9fcfb1c5a448a87ce55d61145f;hb=6815b7a875e95937693864b76a028f92ee2cbf35;hp=a08ae7632f87cf096051b170302b4bb7ef5944ed;hpb=a94fe8052ba36e7ffbf608aa6b69b4a895126e38;p=NDIRC.git diff --git a/Misc.pm b/Misc.pm index a08ae76..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,49 +40,5 @@ sub valuecolor { return $s; } -sub parseCommand { - my ($msg, $server, $nick, $address, $channel, $disp,$model) = @_; - - return if $channel !~ /^#/ && $msg =~ /^~/; - $msg = ".$msg" if $channel !~ /^#/ && $msg =~ /^[^.!]/; - - my ($p,$command,$args) = ($msg =~ /^([.!~])(\S+)(?: (.+))?/); - - if ($msg =~ m{http://[\w.]+/.+?scan(_id|_grp)?=(\w+)}){ - if (!$command || $command =~ m{^http://}){ - ($p,$command,$args) = ('.','addscan',$msg); - }elsif($command ne 'addscan'){ - parseCommand (".addscan $msg", $server, $nick, $address, $channel, $disp,$model) - } - } - - 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;