X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXXml%2FText.pm;fp=perl%2FDXXml%2FText.pm;h=35c83191e504fe8a5909e77ad6bb433012c3d60f;hb=bc67e4afa9b3c9fcf0e537e04a743ad5852356e6;hp=0000000000000000000000000000000000000000;hpb=519f5b39d7b1a035aff12a7ceda4f135b2db1d93;p=spider.git diff --git a/perl/DXXml/Text.pm b/perl/DXXml/Text.pm new file mode 100644 index 00000000..35c83191 --- /dev/null +++ b/perl/DXXml/Text.pm @@ -0,0 +1,70 @@ +# +# XML Text handler +# +# $Id$ +# +# Copyright (c) Dirk Koopman, G1TLH +# + +use strict; + +package DXXml::Text; + +use DXDebug; +use DXProt; +use IsoTime; +use Investigate; +use Time::HiRes qw(gettimeofday tv_interval); + +use vars qw($VERSION $BRANCH @ISA %pings); +$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ ); +$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ || (0,0)); +$main::build += $VERSION; +$main::branch += $BRANCH; + +@ISA = qw(DXXml); + +sub handle_input +{ + my $self = shift; + my $dxchan = shift; + + # this is always routed + if ($self->{to} eq $main::mycall ) { + my $r = DXChannel::get($main::myalias); + $dxchan = $r if $r; + } + $self->route($dxchan); + +} + +sub topcxx +{ + my $self = shift; + my $dxchan = shift; + my @out; + + my $ref = DXUser->get_current($self->{to}); + while (@_) { + my $line = shift; + $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"); + } else { + push @out, pc35($main::mycall, $self->{to}, "$main::mycall:$line"); + } + } + + return $self->{'-pcxx'} = \@out; +} + +sub tocmd +{ + my $self = shift; + + my @out = split /(?:%0D)?\%0A/, $self->{content}; + return $self->{-cmd} = \@out; +} + +1;