X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fdemonstrate.pl;h=53437b966dd5317517b8dc62bb697a00eee58457;hb=611e9ea5204765638eceecbd8e1dd04a4f10a1be;hp=04d50421ef22ba941ba80ed76aa7f21ce65bd529;hpb=1ef2fd58669de7cae92418c4591b9fce5f66bfb0;p=spider.git diff --git a/cmd/demonstrate.pl b/cmd/demonstrate.pl index 04d50421..53437b96 100644 --- a/cmd/demonstrate.pl +++ b/cmd/demonstrate.pl @@ -9,36 +9,23 @@ # my ($self, $line) = @_; -my $mycall = $self->call; -my $myuser = $self->user; -my $mypriv = $self->priv; - my ($call, $newline) = split /\s+/, $line, 2; $call = uc $call; my $dxchan = DXChannel->get($call); +my $mycall = $self->call; return (1, $self->msg('e7', $call)) unless $dxchan; +return (1, $self->msg('e31', $call)) unless $dxchan->is_user; if ($self->remotecmd) { - Log('DXCommand', "$mycall is trying to 'input' $call remotely"); + Log('DXCommand', "$mycall is trying to 'demo' to $call remotely"); return (1, $self->msg('e5')); } -if ($mypriv < 8) { - Log('DXCommand', "$mycall is trying to 'input' $call locally"); +if ($self->priv < 9) { + Log('DXCommand', "$mycall is trying to 'demo' to $call locally"); return (1, $self->msg('e5')); } - -$call = uc $call; -my $user = $dxchan->user; - -# set up basic environment -$self->call($call); -$self->user($user); -$self->priv($dxchan->priv); -Log('DXCommand', "input '$newline' as $call by $mycall"); -my @in = $self->run_cmd($newline); -$self->call($mycall); -$self->user($myuser); -$self->priv($mypriv); +Log('DXCommand', "demo '$newline' to $call by $mycall"); +my @in = $dxchan->run_cmd($newline); $dxchan->send($newline, @in);