return unless $conn;
my $call = $self->{call};
- for (@_) {
-# chomp;
- my @lines = split /\n/;
- for (@lines) {
- $conn->send_later("D$call|$_");
- dbg("-> D $call $_") if isdbg('chan');
+ foreach my $l (@_) {
+ for (ref $l ? @$l : $l) {
+ my @lines = split /\n/;
+ for (@lines) {
+ $conn->send_later("D$call|$_");
+ dbg("-> D $call $_") if isdbg('chan');
+ }
}
}
- $self->{t} = time;
+ $self->{t} = $main::systime;
}
# send a file (always later)
{
my $pkg = shift;
my $class = ref $pkg || $pkg;
- my $self = bless{@_}, $class;
+ my $self = bless{}, $class;
while (@_) {
my $key = shift;
my $val = shift;
$dxchan->send($self->toxml);
} elsif ($dxchan->is_node) {
my $ref = $self->topcxx($dxchan);
- if (ref $ref) {
- for (@$ref) {
- $dxchan->send($_);
- }
- } else {
- $dxchan->send($ref);
- }
+ $dxchan->send($ref);
} else {
my $ref = $self->tocmd($dxchan);
- if (ref $ref) {
- for (@$ref) {
- $dxchan->send($_);
- }
- } else {
- $dxchan->send($ref);
- }
+ $dxchan->send($ref);
}
}
use DXProt;
use IsoTime;
use Investigate;
-use Time::HiRes qw(gettimeofday tv_interval);
use DXXml::Text;
+use DXLog;
use vars qw($VERSION $BRANCH @ISA %pings);
$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
}
Log('rcmd', 'in', $ref->{priv}, $self->{o}, "$self->{content}($answer)");
}
- my $rep = DXXml::Text->new(u=>$self->{u}, to=>$self->{o}, content=>join('%0A', @in));
+ my $rep = DXXml::Text->new(u=>$self->{u}, to=>$self->{o}, content=>join('%0A', map {"$main::mycall:$_"} @in));
$rep->route($main::me); # because it's coming from me!
} else {
$self->route($dxchan);
use DXDebug;
use DXProt;
-use IsoTime;
-use Investigate;
-use Time::HiRes qw(gettimeofday tv_interval);
+use DXLog;
use vars qw($VERSION $BRANCH @ISA %pings);
$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
if ($self->{to} eq $main::mycall) {
my $tochan = DXChannel::get($self->{u} || $main::myalias);
if ($tochan) {
- my $ref = $self->tocmd;
- $tochan->send($_) for (ref $ref ? @$ref : $ref);
+ $tochan->send($self->tocmd);
} else {
dbg("no user or $main::myalias not online") if isdbg('chanerr');
}
$line =~ s/\s*$//;
Log('rcmd', 'out', $self->{to}, $line);
if ($self->{u} && $dxchan->is_clx && $ref->is_clx) {
- push @out, pc85($main::mycall, $self->{to}, $self->{u}, "$main::mycall:$line");
+ push @out, DXProt::pc85($main::mycall, $self->{to}, $self->{u}, "$main::mycall:$line");
} else {
- push @out, pc35($main::mycall, $self->{to}, "$main::mycall:$line");
+ push @out, DXProt::pc35($main::mycall, $self->{to}, "$main::mycall:$line");
}
}