X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fsend.pl;h=9cee791550ca4aa94e4d77d69bcab18cc26a7bd3;hb=579810d363939640538f88a9caa86e01fe9c7709;hp=d6e502cd4f1d82840335fe5bed9c1a1ec389adde;hpb=ba97b5ce3899461ec8b630cc305c58eff36d301f;p=spider.git diff --git a/cmd/send.pl b/cmd/send.pl index d6e502cd..9cee7915 100644 --- a/cmd/send.pl +++ b/cmd/send.pl @@ -32,10 +32,12 @@ $loc->{rrreq} = '0'; if ($self->state eq "prompt") { - my @f = split /\s+/, $line; - + my @f = split /([\s\@\$])/, $line; + @f = map {s/\s+//g; length $_ ? $_ : ()} @f; + # any thing after send? return (1, $self->msg('e6')) if !@f; + return (1, $self->msg('e28')) unless $self->registered || uc $f[0] eq $main::myalias; while (@f) { my $f = uc shift @f; @@ -94,14 +96,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 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 +142,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