X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fsend.pl;h=71cea2bc7f7d0616ac8234516dcda53597e9069e;hb=407d9a80a8af1fa6c1ae2c8fbca833e49da6e816;hp=f6f9e40f762550bb5b9b0ef911860e8827abebce;hpb=7575fa5f2154933e2c80f8fbfc4539e2b40d4b87;p=spider.git diff --git a/cmd/send.pl b/cmd/send.pl index f6f9e40f..71cea2bc 100644 --- a/cmd/send.pl +++ b/cmd/send.pl @@ -32,8 +32,9 @@ $loc->{rrreq} = '0'; if ($self->state eq "prompt") { - my @f = split /\s+/, $line; - + my @f = split /\b/, $line; + @f = map {s/\s+//g; length $_ ? $_ : ()} @f; + # any thing after send? return (1, $self->msg('e6')) if !@f; @@ -94,14 +95,14 @@ if ($self->state eq "prompt") { $loc->{rrreq} = '1'; } elsif ($f eq '<' && @f) { # this is bbs syntax for from call $loc->{from} = uc shift @f; - } elsif ($f eq '@' && @f) { # this is bbs syntax, for origin - $loc->{origin} = uc shift @f; + } elsif (($f =~ /^[\@\.\#\$]$/ || $f eq '.#') && @f) { # this is bbs syntax, for send it 'to node' + shift @f; } elsif ($f =~ /^\$/) { # this is bbs syntax for a bid next; - } elsif ($f =~ /^<\S+/) { # this is bbs syntax for from call - ($loc->{from}) = $f =~ /^<(\S+)$/; - } elsif ($f =~ /^\@\S+/) { # this is bbs syntax for origin - ($loc->{origin}) = $f =~ /^\@(\S+)$/; + } elsif ($f =~ /^<(\S+)/) { # this is bbs syntax for from call + $loc->{from} = $1; + } elsif ($f =~ /^\$\S+/) { # this is bbs syntax for bid + ; } else { # callsign ? @@ -140,12 +141,19 @@ if ($self->state eq "prompt") { delete $self->{loc}; return (1, $self->msg('e6')); } + $loc->{from} ||= $self->call; + unless (is_callsign($loc->{from})) { + delete $self->{loc}; + return (1, $self->msg('e22', $loc->{from})); + } # find me and set the state and the function on my state variable to # keep calling me for every line until I relinquish control $self->func("DXMsg::do_send_stuff"); $self->state('send1'); push @out, $self->msg('m1'); +} else { + push @out, $self->msg('m17', $self->state); } return (1, @out);