projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add standard gcommit command
[spider.git]
/
cmd
/
demonstrate.pl
diff --git
a/cmd/demonstrate.pl
b/cmd/demonstrate.pl
index 179aecf7d38b7ba8d4b1c7dc2d724c5a86ac6dde..1d2231e8ed66c79ae8108fabdec5a8bfb6088d5a 100644
(file)
--- a/
cmd/demonstrate.pl
+++ b/
cmd/demonstrate.pl
@@
-9,36
+9,23
@@
#
my ($self, $line) = @_;
#
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 ($call, $newline) = split /\s+/, $line, 2;
$call = uc $call;
-my $dxchan = DXChannel->get($call);
+my $dxchan = DXChannel::get($call);
+my $mycall = $self->call;
return (1, $self->msg('e7', $call)) unless $dxchan;
return (1, $self->msg('e7', $call)) unless $dxchan;
-if ($self->remotecmd) {
+return (1, $self->msg('e31', $call)) unless $dxchan->is_user;
+if ($self->remotecmd || $self->inscript) {
Log('DXCommand', "$mycall is trying to 'demo' to $call remotely");
return (1, $self->msg('e5'));
}
Log('DXCommand', "$mycall is trying to 'demo' to $call remotely");
return (1, $self->msg('e5'));
}
-if ($
mypriv < 8
) {
+if ($
self->priv < 9
) {
Log('DXCommand', "$mycall is trying to 'demo' to $call locally");
return (1, $self->msg('e5'));
}
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', "demo '$newline' to $call by $mycall");
Log('DXCommand', "demo '$newline' to $call by $mycall");
-my @in = $self->run_cmd($newline);
-$self->call($mycall);
-$self->user($myuser);
-$self->priv($mypriv);
+my @in = $dxchan->run_cmd($newline);
$dxchan->send($newline, @in);
$dxchan->send($newline, @in);