From: Dirk Koopman Date: Tue, 18 Feb 2020 00:38:09 +0000 (+0000) Subject: part of making rcmd work again for async cmds X-Git-Url: http://www.dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=7378e3c43c4448328c2e7a1842244ef7a48f0fdd;hp=8efcd7c490c7b5bf4f2190214b992f91a0dfdc9b;p=spider.git part of making rcmd work again for async cmds --- diff --git a/cmd/show/dx.pl b/cmd/show/dx.pl index 192d252f..19396a70 100644 --- a/cmd/show/dx.pl +++ b/cmd/show/dx.pl @@ -407,7 +407,7 @@ push @out, $self->spawn_cmd("sh/dx $line", \&Spot::search, } } push @out, $self->msg('e3', "sh/dx", "'$line'") unless @out; - $dxchan->send(@out); + return @out; }); #my @res = Spot::search($expr, $fromday, $today, $from, $to, $hint, $dofilter ? $self : undef); diff --git a/cmd/show/groups.pl b/cmd/show/groups.pl index 26aad008..8cbf54e6 100644 --- a/cmd/show/groups.pl +++ b/cmd/show/groups.pl @@ -103,7 +103,7 @@ sub handle } push (@out, "-"); } - $self->send(@out) if @out; + return @out; }); # my @chatlog = DXLog::print(undef, $to, $main::systime, 'chat', undef); diff --git a/perl/DXCommandmode.pm b/perl/DXCommandmode.pm index cbba3b79..4212d968 100644 --- a/perl/DXCommandmode.pm +++ b/perl/DXCommandmode.pm @@ -1328,9 +1328,10 @@ sub spawn_cmd return; } if ($cb) { - $cb->($dxchan, @res); - } else { - return unless @res; + # transform output if required + @res = $cb->($dxchan, @res); + } + if (@res) { if (defined $prefix) { $dxchan->send(map {"$prefix$_"} @res); } else {