X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?p=spider.git;a=blobdiff_plain;f=cmd%2Fsend.pl;h=71cea2bc7f7d0616ac8234516dcda53597e9069e;hp=59b535f73fae60da27fe6388345d4dfa9723752c;hb=14f2cd924047e8d99aa2f5796f8f34ee80802651;hpb=40310b181de51fd4917e74f4672aa31a5f255c34 diff --git a/cmd/send.pl b/cmd/send.pl index 59b535f7..71cea2bc 100644 --- a/cmd/send.pl +++ b/cmd/send.pl @@ -33,7 +33,8 @@ $loc->{rrreq} = '0'; if ($self->state eq "prompt") { 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 =~ /^[\@\.\#]$/ || $f eq '.#') && @f) { # this is bbs syntax, for send it 'to node' + } 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,6 +141,11 @@ 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