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;
$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 ?
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